An emulator, assembler, and disassembler for the Sega Game Gear
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

makefile 957 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 = gcc
  8. FLAGS = -O2 -Wall -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. SRCS = $(foreach d,.,$(wildcard *.c)) $(foreach d,$(SOURCES),$(wildcard $(addprefix $(d)/*,.c)))
  15. OBJS = $(patsubst %.c,%.o,$(addprefix $(BUILD)/$(MODE)/,$(SRCS)))
  16. DEPS = $(OBJS:%.o=%.d)
  17. DIRS = $(sort $(dir $(OBJS)))
  18. ifdef DEBUG
  19. PROGRAM := $(PROGRAM)$(DEVEXT)
  20. FLAGS += -g
  21. MODE = debug
  22. endif
  23. .PHONY: all clean
  24. all: $(PROGRAM)
  25. clean:
  26. $(RM) $(PROGRAM) $(PROGRAM)$(DEVEXT) $(BUILD)
  27. $(DIRS):
  28. $(MKDIR) $@
  29. $(PROGRAM): $(OBJS)
  30. $(CC) $(FLAGS) $(LIBS) $(OBJS) -o $@
  31. $(OBJS): | $(DIRS)
  32. $(BUILD)/$(MODE)/%.o: %.c
  33. $(CC) $(FLAGS) $(CFLAGS) -MMD -MP -c $< -o $@
  34. -include $(DEPS)