help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing a simple make file?


From: Andre Poenitz
Subject: Re: Writing a simple make file?
Date: Fri, 19 Aug 2005 21:54:20 +0200

ovesvenssons@hotmail.com wrote:
> I suppose I have to move the object file at the end of target "%.o" to
> the "build" directory, but I don't know how.

Try


# ============
#  Variables
# ============
PROGRAM = program.bin

CXX = c++

SOURCES = $(shell ls src/*.cpp)
OBJECTS = $(SOURCES:src/%.cpp=build/%.o)

INCS = -Iinclude -Igfx
LIBS = -L/app/glib/1.2.10/lib -L/app/gtk+/1.2.10/lib

# ============
#  Targets
# ============
$(PROGRAM): $(OBJECTS)
        $(CXX) -o $(PROGRAM) $(OBJECTS) $(LIBS)

build/%.o : src/%.cpp
        $(CXX) -c $(INCS) -o $@ $<


clean:
        \rm src/*.o $(PROGRAM)


Andre'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]