Simulator kompilierbar.
[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 LEVELLIST = levels.txt
11
12 GLADEFILES = lcd-display.glade
13
14 BADGE_CXXSRCS = mock-main.cc \
15 mock/badge_worker.cc \
16 mock/display.cc \
17 mock/event.cc \
18 mock/lcd-window.cc
19 BADGE_CSRCS = badge_main_loop.c
20
21 BADGE_FAROBJS = ui/font.o \
22 ui/menu.o \
23 ui/sprite.o \
24 jumpnrun/collision.o \
25 jumpnrun/enemies.o \
26 jumpnrun/game_state.o \
27 jumpnrun/items.o \
28 jumpnrun/jumpnrun.o \
29 jumpnrun/level_load.o \
30 jumpnrun/player.o \
31 jumpnrun/render.o \
32 jumpnrun/shots.o \
33 jumpnrun/stats.o \
34 jumpnrun/tiles.o
35
36 BADGE_CXXOBJS = $(BADGE_CXXSRCS:%.cc=%.o)
37 BADGE_COBJS = $(BADGE_CSRCS:%.c=%.o)
38 BADGE_OBJS = $(BADGE_CXXOBJS) $(BADGE_COBJS) $(BADGE_FAROBJS)
39
40 CONVERTER_SRCS = tools/level-converter.cc
41 CONVERTER_OBJS = $(CONVERTER_SRCS:%.cc=%.o)
42
43 CDEPS = $(BADGE_CSRCS:%.c=%.dep)
44 CXXDEPS = $(BADGE_CXXSRCS:%.cc=%.dep) $(CONVERTER_SRCS:%.cc=%.dep)
45 FARDEPS = $(BADGE_FAROBJS:%.o=%.dep)
46 DEPS = $(CDEPS) $(CXXDEPS) $(FARDEPS)
47
48 RM = rm -f
49
50 .PHONY: all dep clean distclean play
51
52 all: dep $(BADGE) $(CONVERTER)
53
54
55 $(BADGE_COBJS) : %.o : %.c
56 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
57
58 $(BADGE_CXXOBJS) : %.o : %.cc
59 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
60
61 $(BADGE_FAROBJS) : %.o : ../badge/%.c
62 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
63
64 $(BADGE): $(BADGE_OBJS)
65 $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LDLIBS)
66
67 dep: $(DEPS)
68
69 $(CDEPS): %.dep : %.c
70 $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
71
72 $(CXXDEPS): %.dep : %.cc
73 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
74
75 $(FARDEPS): %.dep : ../badge/%.c
76 $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
77
78 sinclude $(DEPS)
79
80 clean:
81 $(RM) $(BADGE_OBJS) $(CONVERTER_OBJS) $(BADGE) $(CONVERTER)
82
83 distclean: clean
84 $(RM) $(DEPS) $(wildcard *~)
85
86 $(CONVERTER): $(CONVERTER_OBJS)
87 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LDLIBS)
88
89 play: all
90 echo > $(LEVELLIST)
91 ls ../badge/jumpnrun/levels/*.lv | xargs -n1 basename | cut -d . -f 1 > $(LEVELLIST)
92 ./$(CONVERTER)
93 ./$(BADGE)
This page took 0.044862 seconds and 5 git commands to generate.