MenĂ¼position merken.
[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
7 BADGE = badge
8 CONVERTER = level-converter
9
10 GLADEFILES = lcd-display.glade
11
12 BADGE_CXXSRCS = mock-main.cc \
13 mock/badge_worker.cc \
14 mock/display.cc \
15 mock/event.cc \
16 mock/lcd-window.cc
17 BADGE_CSRCS = badge_main_loop.c
18
19 BADGE_FAROBJS = ui/font.o \
20 ui/menu.o \
21 ui/sprite.o \
22 jumpnrun/collision.o \
23 jumpnrun/enemies.o \
24 jumpnrun/game_state.o \
25 jumpnrun/items.o \
26 jumpnrun/jumpnrun.o \
27 jumpnrun/level_load.o \
28 jumpnrun/player.o \
29 jumpnrun/render.o \
30 jumpnrun/shots.o \
31 jumpnrun/stats.o \
32 jumpnrun/tiles.o
33
34 BADGE_CXXOBJS = $(BADGE_CXXSRCS:%.cc=%.o)
35 BADGE_COBJS = $(BADGE_CSRCS:%.c=%.o)
36 BADGE_OBJS = $(BADGE_CXXOBJS) $(BADGE_COBJS) $(BADGE_FAROBJS)
37
38 CONVERTER_SRCS = tools/level-converter.cc
39 CONVERTER_OBJS = $(CONVERTER_SRCS:%.cc=%.o)
40
41 CDEPS = $(BADGE_CSRCS:%.c=%.dep)
42 CXXDEPS = $(BADGE_CXXSRCS:%.cc=%.dep) $(CONVERTER_SRCS:%.cc=%.dep)
43 FARDEPS = $(BADGE_FAROBJS:%.o=%.dep)
44 DEPS = $(CDEPS) $(CXXDEPS) $(FARDEPS)
45
46 LDLIBS = $$(pkg-config --libs gtkmm-3.0)
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.049281 seconds and 5 git commands to generate.