diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Makefile b/Makefile index 7f503ba..a4fe8ff 100644 --- a/Makefile +++ b/Makefile | |||
@@ -1,12 +1,15 @@ | |||
1 | OBJS = mazeoflife.o titlestate.o htpstate.o gamestate.o | 1 | SOURCES = mazeoflife.cpp titlestate.cpp htpstate.cpp gamestate.cpp |
2 | OBJS = $(SOURCES:.cpp=.cpp.o) | ||
3 | IMAGES = title.bmp pointer.bmp htp1.bmp htp2.bmp | ||
4 | CIMAGES = $(IMAGES:.bmp=.bmp.o) | ||
2 | CC = g++ | 5 | CC = g++ |
3 | CFLAGS = `pkg-config sdl --cflags` | 6 | CFLAGS = `pkg-config sdl --cflags` |
4 | LIBS = `pkg-config sdl --libs` | 7 | LIBS = `pkg-config sdl --libs` |
5 | 8 | ||
6 | mazeoflife: $(OBJS) | 9 | mazeoflife: $(OBJS) $(CIMAGES) |
7 | $(CC) $(OBJS) $(LIBS) -o mazeoflife | 10 | $(CC) $(OBJS) $(CIMAGES) $(LIBS) -o mazeoflife |
8 | 11 | ||
9 | %.o: %.cpp | 12 | %.cpp.o: %.cpp |
10 | $(CC) -c $< $(CFLAGS) -o $@ | 13 | $(CC) -c $< $(CFLAGS) -o $@ |
11 | 14 | ||
12 | %.d: %.cpp | 15 | %.d: %.cpp |
@@ -15,7 +18,10 @@ mazeoflife: $(OBJS) | |||
15 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ | 18 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ |
16 | rm -f $@.$$$$ | 19 | rm -f $@.$$$$ |
17 | 20 | ||
18 | include $(OBJS:.o=.d) | 21 | %.bmp.o: %.bmp |
22 | objcopy --input binary --output elf32-i386 -B i386 $< $@ | ||
23 | |||
24 | include $(OBJS:.cpp.o=.d) | ||
19 | 25 | ||
20 | clean: | 26 | clean: |
21 | rm -rdfv $(OBJS) $(OBJS:.o=.d) mazeoflife | 27 | rm -rdfv $(OBJS) $(OBJS:.cpp.o=.d) $(CIMAGES) mazeoflife |