TOPDIR = . # If $(way) is set then we define $(way_) and $(_way) from it in the # obvious fashion. ifeq "$(way)" "p" way_ := $(way)_ _way := _$(way) endif include $(TOPDIR)/mk/config.mk HC_OPTS += -fglasgow-exts BIN_DEPS += mtl ALL_DIRS = cbits . EXCLUDED_SRCS=CopMain.hs RobberMain.hs RobberMcGruffMain.hs PKG = icfp05 LIBRARY = libicfp05$(_way).a INSTALL_HEADERS = $(wildcard cbits/*.h) # this rule must remain first default: boot lib $(PKG).conf robber cop stupid-robber cop2 # Now build the interface to the library BIN_FLAGS=-package-conf $(PKG).conf -package $(PKG) RobberMain.$(way_)o: RobberMain.hs $(LIBRARY) $(PKG).conf $(GHC) $(HC_OPTS) $(BIN_FLAGS) -c $< -o $@ -ohi $(basename $@).$(way_)hi CopMain.$(way_)o: CopMain.hs $(LIBRARY) $(PKG).conf $(GHC) $(HC_OPTS) $(BIN_FLAGS) -c $< -o $@ -ohi $(basename $@).$(way_)hi robber: $(LIBRARY) RobberMain.$(way_)o $(call make-binary,$@,RobberMain.$(way_)o) cop: $(LIBRARY) CopMain.$(way_)o $(call make-binary,$@,CopMain.$(way_)o) cop2: $(LIBRARY) EvilCop.$(way_)o $(call make-binary,$@,EvilCop.$(way_)o) stupid-robber: $(LIBRARY) RobberMcGruffMain.$(way_)o $(call make-binary,$@,RobberMcGruffMain.$(way_)o) include $(TOPDIR)/mk/rules.mk # # Let's run the testsuite # .PHONY: check check: @( cd tests/standalone-tests/driver ; ./check ${TEST} ) @echo @echo "====== running unit tests =========" @( cd tests/unit-tests && make run-utests && ./run-utests ) # Dependency orders ifeq ($(MAKECMDGOALS),clean) #empty else ifeq ($(MAKECMDGOALS),distclean) #empty else -include $(TOPDIR)/depend endif endif DIST_CLEAN_FILES+=pp/logpp CLEAN_FILES+=cop robber