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