summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
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 @@
1OBJS = mazeoflife.o titlestate.o htpstate.o gamestate.o 1SOURCES = mazeoflife.cpp titlestate.cpp htpstate.cpp gamestate.cpp
2OBJS = $(SOURCES:.cpp=.cpp.o)
3IMAGES = title.bmp pointer.bmp htp1.bmp htp2.bmp
4CIMAGES = $(IMAGES:.bmp=.bmp.o)
2CC = g++ 5CC = g++
3CFLAGS = `pkg-config sdl --cflags` 6CFLAGS = `pkg-config sdl --cflags`
4LIBS = `pkg-config sdl --libs` 7LIBS = `pkg-config sdl --libs`
5 8
6mazeoflife: $(OBJS) 9mazeoflife: $(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
18include $(OBJS:.o=.d) 21%.bmp.o: %.bmp
22 objcopy --input binary --output elf32-i386 -B i386 $< $@
23
24include $(OBJS:.cpp.o=.d)
19 25
20clean: 26clean:
21 rm -rdfv $(OBJS) $(OBJS:.o=.d) mazeoflife 27 rm -rdfv $(OBJS) $(OBJS:.cpp.o=.d) $(CIMAGES) mazeoflife