GameBoy (Color) port of the GTA San Andreas arcade game Duality
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 901B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Adapted from GBDK-2020 examples
  2. ifndef GBDK_HOME
  3. GBDK_HOME = ../../../
  4. endif
  5. BIN := duality.gb
  6. SRC_DIR := src
  7. BUILD_DIR := build
  8. SRCS := $(wildcard $(SRC_DIR)/*.c)
  9. OBJS := $(SRCS:%.c=$(BUILD_DIR)/%.o)
  10. LCC := $(GBDK_HOME)/bin/lcc
  11. GB_EMU := gearboy
  12. LCCFLAGS := -Wa-l -Wl-m -Wm"-yn Duality"
  13. EMUFLAGS := $(BIN)
  14. GBDK_DEBUG = ON
  15. ifdef GBDK_DEBUG
  16. LCCFLAGS += -debug -Wa-j -Wa-y -Wa-s -Wl-j -Wl-y -Wl-u -Wm-yS
  17. EMUFLAGS += $(BUILD_DIR)/$(BIN:.gb=.sym)
  18. endif
  19. .PHONY: all run $(BIN) clean
  20. all: $(BIN)
  21. run: $(BIN)
  22. @echo Emulating $<
  23. @$(GB_EMU) $(EMUFLAGS)
  24. $(BUILD_DIR)/%.o: %.c
  25. @mkdir -p $(@D)
  26. @echo Compiling $<
  27. @$(LCC) $(LCCFLAGS) -c -o $@ $<
  28. $(BUILD_DIR)/%.o: %.s
  29. @mkdir -p $(@D)
  30. @echo Assembling $<
  31. @$(LCC) $(LCCFLAGS) -c -o $@ $<
  32. $(BUILD_DIR)/$(BIN): $(OBJS)
  33. @echo Linking $@
  34. @$(LCC) $(LCCFLAGS) -o $@ $<
  35. $(BIN): $(BUILD_DIR)/$(BIN)
  36. @cp $< $@
  37. clean:
  38. rm -rf $(BUILD_DIR) $(BIN)