Sprites, sprites, sprites
[hackover2013-badge-firmware.git] / mock / Makefile
1 #!/usr/bin/make -f
2
3 CPPFLAGS = $$(pkg-config --cflags gtkmm-3.0) -I. -I ../badge
4 CFLAGS = -Wall -Wextra -pedantic -std=c99 -Werror -O0 -g -fstack-protector-all
5 CXXFLAGS = -Wall -Wextra -pedantic -std=c++0x -Werror -O0 -g -fstack-protector-all
6 LDLIBS = $$(pkg-config --libs gtkmm-3.0)
7
8 BADGE = badge
9 CONVERTER = level-converter
10
11 GLADEFILES = lcd-display.glade
12
13 BADGE_CXXSRCS = mock-main.cc \
14 mock/badge_worker.cc \
15 mock/display.cc \
16 mock/event.cc \
17 mock/lcd-window.cc
18 BADGE_CSRCS = badge_main_loop.c
19
20 BADGE_FAROBJS = ui/font.o \
21 ui/menu.o \
22 ui/sprite.o \
23 jumpnrun/collision.o \
24 jumpnrun/enemies.o \
25 jumpnrun/game_state.o \
26 jumpnrun/items.o \
27 jumpnrun/jumpnrun.o \
28 jumpnrun/level_load.o \
29 jumpnrun/player.o \
30 jumpnrun/render.o \
31 jumpnrun/shots.o \
32 jumpnrun/stats.o \
33 jumpnrun/tiles.o
34
35 BADGE_CXXOBJS = $(BADGE_CXXSRCS:%.cc=%.o)
36 BADGE_COBJS = $(BADGE_CSRCS:%.c=%.o)
37 BADGE_OBJS = $(BADGE_CXXOBJS) $(BADGE_COBJS) $(BADGE_FAROBJS)
38
39 CONVERTER_SRCS = tools/level-converter.cc
40 CONVERTER_OBJS = $(CONVERTER_SRCS:%.cc=%.o)
41
42 CDEPS = $(BADGE_CSRCS:%.c=%.dep)
43 CXXDEPS = $(BADGE_CXXSRCS:%.cc=%.dep) $(CONVERTER_SRCS:%.cc=%.dep)
44 FARDEPS = $(BADGE_FAROBJS:%.o=%.dep)
45 DEPS = $(CDEPS) $(CXXDEPS) $(FARDEPS)
46
47 RM = rm -f
48
49 .PHONY: all dep clean distclean play
50
51 all: dep $(BADGE) $(CONVERTER)
52
53
54 $(BADGE_COBJS) : %.o : %.c
55 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
56
57 $(BADGE_CXXOBJS) : %.o : %.cc
58 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
59
60 $(BADGE_FAROBJS) : %.o : ../badge/%.c
61 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
62
63 $(BADGE): $(BADGE_OBJS)
64 $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LDLIBS)
65
66 dep: $(DEPS)
67
68 $(CDEPS): %.dep : %.c
69 $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
70
71 $(CXXDEPS): %.dep : %.cc
72 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
73
74 $(FARDEPS): %.dep : ../badge/%.c
75 $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
76
77 sinclude $(DEPS)
78
79 clean:
80 $(RM) $(BADGE_OBJS) $(CONVERTER_OBJS) $(BADGE) $(CONVERTER)
81
82 distclean: clean
83 $(RM) $(DEPS) $(wildcard *~)
84
85 $(CONVERTER): $(CONVERTER_OBJS)
86 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $+
87
88 play: all
89 ./$(CONVERTER)
90 ./$(BADGE)
This page took 0.047226 seconds and 5 git commands to generate.