X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/875a5450a1974299bbfad500c4b0d5eedb60fc7c..b2d84a4b240edc1e4e15793180529eacce45cec8:/mock/Makefile?ds=sidebyside diff --git a/mock/Makefile b/mock/Makefile index 5b9f293..a62a8e3 100644 --- a/mock/Makefile +++ b/mock/Makefile @@ -1,42 +1,50 @@ #!/usr/bin/make -f CPPFLAGS = $$(pkg-config --cflags gtkmm-3.0) -I. -I ../badge -CFLAGS = -Wall -Wextra -pedantic -std=c99 -Werror -O0 -g -CXXFLAGS = -Wall -Wextra -pedantic -std=c++11 -Werror -O0 -g +CFLAGS = -Wall -Wextra -pedantic -std=c99 -Werror -O0 -g -fstack-protector-all +CXXFLAGS = -Wall -Wextra -pedantic -std=c++0x -Werror -O0 -g -fstack-protector-all +LDLIBS = $$(pkg-config --libs gtkmm-3.0) BADGE = badge CONVERTER = level-converter +LEVELLIST = levels.txt GLADEFILES = lcd-display.glade -VPATH = ../badge - BADGE_CXXSRCS = mock-main.cc \ mock/badge_worker.cc \ mock/display.cc \ mock/event.cc \ mock/lcd-window.cc -BADGE_CSRCS = badge_main_loop.c \ - ui/sprite.c \ - jumpnrun/collision.c \ - jumpnrun/enemies.c \ - jumpnrun/items.c \ - jumpnrun/jumpnrun.c \ - jumpnrun/tiles.c \ - jumpnrun/level_load.c +BADGE_CSRCS = badge_main_loop.c + +BADGE_FAROBJS = ui/font.o \ + ui/menu.o \ + ui/sprite.o \ + jumpnrun/collision.o \ + jumpnrun/enemies.o \ + jumpnrun/game_state.o \ + jumpnrun/items.o \ + jumpnrun/jumpnrun.o \ + jumpnrun/level_load.o \ + jumpnrun/player.o \ + jumpnrun/render.o \ + jumpnrun/shots.o \ + jumpnrun/stats.o \ + jumpnrun/tiles.o BADGE_CXXOBJS = $(BADGE_CXXSRCS:%.cc=%.o) BADGE_COBJS = $(BADGE_CSRCS:%.c=%.o) -BADGE_OBJS = $(BADGE_CXXOBJS) $(BADGE_COBJS) +BADGE_OBJS = $(BADGE_CXXOBJS) $(BADGE_COBJS) $(BADGE_FAROBJS) CONVERTER_SRCS = tools/level-converter.cc CONVERTER_OBJS = $(CONVERTER_SRCS:%.cc=%.o) CDEPS = $(BADGE_CSRCS:%.c=%.dep) CXXDEPS = $(BADGE_CXXSRCS:%.cc=%.dep) $(CONVERTER_SRCS:%.cc=%.dep) -DEPS = $(CDEPS) $(CXXDEPS) +FARDEPS = $(BADGE_FAROBJS:%.o=%.dep) +DEPS = $(CDEPS) $(CXXDEPS) $(FARDEPS) -LDLIBS = $$(pkg-config --libs gtkmm-3.0) RM = rm -f .PHONY: all dep clean distclean play @@ -45,21 +53,27 @@ all: dep $(BADGE) $(CONVERTER) $(BADGE_COBJS) : %.o : %.c - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c -o $(@:../badge/%=%) $< $(LDLIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< $(BADGE_CXXOBJS) : %.o : %.cc - $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -c -o $@ $< $(LDLIBS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< + +$(BADGE_FAROBJS) : %.o : ../badge/%.c + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< $(BADGE): $(BADGE_OBJS) - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $(+:../badge/%=%) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LDLIBS) dep: $(DEPS) $(CDEPS): %.dep : %.c - $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $(<:%.c=%.o) -MF $@ + $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@ $(CXXDEPS): %.dep : %.cc - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MM $< -MT $(<:%.cc=%.o) -MF $@ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@ + +$(FARDEPS): %.dep : ../badge/%.c + $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@ sinclude $(DEPS) @@ -70,8 +84,10 @@ distclean: clean $(RM) $(DEPS) $(wildcard *~) $(CONVERTER): $(CONVERTER_OBJS) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $+ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LDLIBS) play: all + echo > $(LEVELLIST) + ls ../badge/jumpnrun/levels/*.lv | xargs -n1 basename | cut -d . -f 1 > $(LEVELLIST) ./$(CONVERTER) ./$(BADGE)