-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (47 loc) · 2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKIT65XX)),)
$(error "Please set DEVKIT65XX in your environment. export DEVKIT65XX=<path to>devkit65XX")
endif
include $(DEVKIT65XX)/snes_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
#---------------------------------------------------------------------------------
TARGET := bw
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS += $(INCLUDE)
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PVSNESLIB)
GFXDIR := ./gfx/bmp/
SNDDIR := ./snd/wav/
SRCDIR := ./src/
OBJDIR := $(SRCDIR) $(shell ls -d $(SRCDIR)/*/) $(GFXDIR) $(SNDDIR)
BINDIR := ./bin/
export OUTPUT:= $(BINDIR)/$(TARGET)
#---------------------------------------------------------------------------------
export OFILES := $(foreach dir,$(OBJDIR),$(wildcard $(dir)/*.obj))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
GTITLE := -ht"$(TARGET)"
#---------------------------------------------------------------------------------
all:
$(MAKE) -C $(GFXDIR)
$(MAKE) -C $(SNDDIR)
$(MAKE) -C $(SRCDIR)
mkdir -p $(BINDIR)
$(MAKE) $(OUTPUT).sfc
$(SNTOOLS) -hi! $(GTITLE) $(OUTPUT).sfc
clean:
$(MAKE) clean -C $(GFXDIR)
$(MAKE) clean -C $(SNDDIR)
$(MAKE) clean -C $(SRCDIR)
rm -f $(OUTPUT).sfc $(OUTPUT).sym
#---------------------------------------------------------------------------------
$(OUTPUT).sfc: $(OFILES)