An emulator, assembler, and disassembler for the Sega Game Gear
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

9 лет назад
9 лет назад
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright (C) 2014 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. # Released under the terms of the MIT License. See LICENSE for details.
  3. PROGRAM = crater
  4. SOURCES = src
  5. BUILD = build
  6. DEVEXT = -dev
  7. CC = clang
  8. FLAGS = -O2 -Wall -Wextra -pedantic -std=c11
  9. CFLAGS = $(shell sdl2-config --cflags)
  10. LIBS = $(shell sdl2-config --libs)
  11. MKDIR = mkdir -p
  12. RM = rm -rf
  13. MODE = release
  14. BNRY = $(PROGRAM)
  15. SRCS = $(foreach d,.,$(wildcard *.c)) $(foreach d,$(SOURCES),$(wildcard $(addprefix $(d)/*,.c)))
  16. OBJS = $(patsubst %.c,%.o,$(addprefix $(BUILD)/$(MODE)/,$(SRCS)))
  17. DEPS = $(OBJS:%.o=%.d)
  18. DIRS = $(sort $(dir $(OBJS)))
  19. ifdef DEBUG
  20. BNRY := $(BNRY)$(DEVEXT)
  21. FLAGS += -g -DDEBUG_MODE
  22. MODE = debug
  23. endif
  24. .PHONY: all clean test
  25. all: $(BNRY)
  26. clean:
  27. $(RM) $(BUILD) $(PROGRAM) $(PROGRAM)$(DEVEXT)
  28. test:
  29. @echo "not implemented yet"
  30. $(DIRS):
  31. $(MKDIR) $@
  32. $(BNRY): $(OBJS)
  33. $(CC) $(FLAGS) $(LIBS) $(OBJS) -o $@
  34. $(OBJS): | $(DIRS)
  35. $(BUILD)/$(MODE)/%.o: %.c
  36. $(CC) $(FLAGS) $(CFLAGS) -MMD -MP -c $< -o $@
  37. -include $(DEPS)