summary refs log tree commit diff stats
path: root/Makefile
blob: a4fe8ff5057d5fedf06f5c882ac631cf6d8ebe70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SOURCES = mazeoflife.cpp titlestate.cpp htpstate.cpp gamestate.cpp
OBJS = $(SOURCES:.cpp=.cpp.o)
IMAGES = title.bmp pointer.bmp htp1.bmp htp2.bmp
CIMAGES = $(IMAGES:.bmp=.bmp.o)
CC = g++
CFLAGS = `pkg-config sdl --cflags`
LIBS = `pkg-config sdl --libs`

mazeoflife: $(OBJS) $(CIMAGES)
	$(CC) $(OBJS) $(CIMAGES) $(LIBS) -o mazeoflife

%.cpp.o: %.cpp
	$(CC) -c $< $(CFLAGS) -o $@

%.d: %.cpp
	@set -e; rm -f $@; \
	$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	rm -f $@.$$$$

%.bmp.o: %.bmp
	objcopy --input binary --output elf32-i386 -B i386 $< $@

include $(OBJS:.cpp.o=.d)

clean:
	rm -rdfv $(OBJS) $(OBJS:.cpp.o=.d) $(CIMAGES) mazeoflife