summary refs log tree commit diff stats
path: root/Makefile
blob: 7f503ba70c8d3a06e0409b684498f2c85bd5ba55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OBJS = mazeoflife.o titlestate.o htpstate.o gamestate.o
CC = g++
CFLAGS = `pkg-config sdl --cflags`
LIBS = `pkg-config sdl --libs`

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

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

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

include $(OBJS:.o=.d)

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