Results 1 to 2 of 2
Hi all
I have a problem with my makefile. I have the makefile in the directory 'source' and I want to have the compiled program in an other directory, something ...
- 03-10-2010 #1Just Joined!
- Join Date
- Mar 2010
- Location
- Belgium
- Posts
- 4
[SOLVED] Makefile - destination directory
Hi all
I have a problem with my makefile. I have the makefile in the directory 'source' and I want to have the compiled program in an other directory, something like 'bin' or so.
This is the makefile like it is now:
ThxCode:COMPILER = gcc CCFLAGS = -Wall -g `xml2-config --cflags` LIBS = `xml2-config --libs` main: main.o stack.o ${COMPILER} ${CCFLAGS} ${LIBS} -o main main.o stack.o main.o: main.c ${COMPILER} ${CCFLAGS} ${LIBS} -c main.c stack.o: stack.c ${COMPILER} ${CCFLAGS} ${LIBS} -c stack.c
- 03-12-2010 #2Just Joined!
- Join Date
- Mar 2010
- Location
- Belgium
- Posts
- 4
Ok
I found it myself.
I put the makefile in the destination directory. And change the makefile like this:
Code:COMPILER = gcc CCFLAGS = -Wall -g `xml2-config --cflags` LIBS = `xml2-config --libs` DIR = /home/workspace/project/source/ main: main.o stack.o ${COMPILER} ${CCFLAGS} ${LIBS} -o main main.o stack.o main.o: {DIR}main.c ${COMPILER} ${CCFLAGS} ${LIBS} -c {DIR}main.c stack.o: {DIR}stack.c ${COMPILER} ${CCFLAGS} ${LIBS} -c {DIR}stack.c


