b0639c999fd42fed08c92aaa70e381d6d7dfc774
[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
5 CXXFLAGS = -Wall -Wextra -pedantic -std=c++11 -Werror -O0 -g
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/sprite.o \
21 jumpnrun/collision.o \
22 jumpnrun/enemies.o \
23 jumpnrun/game_state.o \
24 jumpnrun/items.o \
25 jumpnrun/jumpnrun.o \
26 jumpnrun/level_load.o \
27 jumpnrun/player.o \
28 jumpnrun/render.o \
29 jumpnrun/shots.o \
30 jumpnrun/stats.o \
31 jumpnrun/tiles.o
32
33 BADGE_CXXOBJS = $(BADGE_CXXSRCS:%.cc=%.o)
34 BADGE_COBJS = $(BADGE_CSRCS:%.c=%.o)
35 BADGE_OBJS = $(BADGE_CXXOBJS) $(BADGE_COBJS) $(BADGE_FAROBJS)
36
37 CONVERTER_SRCS = tools/level-converter.cc
38 CONVERTER_OBJS = $(CONVERTER_SRCS:%.cc=%.o)
39
40 CDEPS = $(BADGE_CSRCS:%.c=%.dep)
41 CXXDEPS = $(BADGE_CXXSRCS:%.cc=%.dep) $(CONVERTER_SRCS:%.cc=%.dep)
42 FARDEPS = $(BADGE_FAROBJS:%.o=%.dep)
43 DEPS = $(CDEPS) $(CXXDEPS) $(FARDEPS)
44
45 LDLIBS = $$(pkg-config --libs gtkmm-3.0)
46 RM = rm -f
47
48 .PHONY: all dep clean distclean play
49
50 all: dep $(BADGE) $(CONVERTER)
51
52
53 $(BADGE_COBJS) : %.o : %.c
54 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
55
56 $(BADGE_CXXOBJS) : %.o : %.cc
57 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
58
59 $(BADGE_FAROBJS) : %.o : ../badge/%.c
60 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
61
62 $(BADGE): $(BADGE_OBJS)
63 $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LDLIBS)
64
65 dep: $(DEPS)
66
67 $(CDEPS): %.dep : %.c
68 $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
69
70 $(CXXDEPS): %.dep : %.cc
71 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
72
73 $(FARDEPS): %.dep : ../badge/%.c
74 $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@
75
76 sinclude $(DEPS)
77
78 clean:
79 $(RM) $(BADGE_OBJS) $(CONVERTER_OBJS) $(BADGE) $(CONVERTER)
80
81 distclean: clean
82 $(RM) $(DEPS) $(wildcard *~)
83
84 $(CONVERTER): $(CONVERTER_OBJS)
85 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $+
86
87 play: all
88 ./$(CONVERTER)
89 ./$(BADGE)
This page took 0.040189 seconds and 3 git commands to generate.