CC = gcc -Wall -std=c99
editor:
$(CC) editor/main.c -oedit `sdl-config --cflags --libs` -s -O4
all:
$(CC) editor/main.c -oedit `sdl-config --cflags --libs` -s -O4
Make files confuse me
well this is my Makefile:
Why is it that it works when I go make all, but when I go make editor it goes:
make: `editor' is up to date.
AMP Minibowling - Free asynchronous multiplayer mobile minigolf+bowling
[twitter]eedok[/twitter]
After the colon in a rul should be listed the dependencies for that target. If a dependency gets modified, the target gets rebuilt.
For example:
The first rule is the one that gets selected if you just do make (as opposed to, say, make editor).
Using GNU make, there are a number of ways you can simplify your makefile: check out the info pages (info make), or the manual.
For example:
CC = gcc -Wall -std=c99all: editoreditor: editor/main.c $(CC) editor/main.c -oedit `sdl-config --cflags --libs` -s -O4
The first rule is the one that gets selected if you just do make (as opposed to, say, make editor).
Using GNU make, there are a number of ways you can simplify your makefile: check out the info pages (info make), or the manual.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Maybe a bit of tweaking:
Anyway the reason why its not updating is that it see the directory 'editor' already exists with no dependencies, so it doesnt bother trying to compile it.
You might want to peek at This Thread for some other ideas.
-oddbot
CC=gccCFLAGS= -Wall -std=c99 `sdl-config --cflags` -s -O4LDFLAGS= `sdl-config --libs`all: editedit: editor/main.c $(CC) -oedit main.c $(CFLAGS) $(LDFLAGS)
Anyway the reason why its not updating is that it see the directory 'editor' already exists with no dependencies, so it doesnt bother trying to compile it.
You might want to peek at This Thread for some other ideas.
-oddbot
Consider Jam (http://www.perforce.com/jam/jam.html) if you're not such a big fan of make.
"There is no dark side of the moon really,
As a matter of fact, its all dark."
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement