Debian Codegraph @

port/ds/Makefile

raw symbols SCIP
1 #---------------------------------------------------------------------------------
2 .SUFFIXES:
3 #---------------------------------------------------------------------------------
4
5 ifeq ($(strip $(DEVKITARM)),)
6 $(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
7 endif
8
9 include $(DEVKITARM)/ds_rules
10
11 #---------------------------------------------------------------------------------
12 # TARGET is the name of the output
13 # BUILD is the directory where object files & intermediate files will be placed
14 # SOURCES is a list of directories containing source code
15 # INCLUDES is a list of directories containing extra header files
16 #---------------------------------------------------------------------------------
17 TARGET := powder
18
19 #---------------------------------------------------------------------------------
20 # any extra libraries we wish to link with the project
21 #---------------------------------------------------------------------------------
22 LIBS := -lfat -lnds9
23
24
25 #---------------------------------------------------------------------------------
26 # list of directories containing libraries, this must be the top level containing
27 # include and lib
28 #---------------------------------------------------------------------------------
29 LIBDIRS := $(LIBNDS)
30 #---------------------------------------------------------------------------------
31 # options for code generation
32 #---------------------------------------------------------------------------------
33 ARCH := -mthumb -mthumb-interwork
34
35 INCLUDE := -I$(LIBNDS)/include -I$(CURDIR)
36
37 LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
38
39 CFLAGS := -g -Wall -O1\
40 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer\
41 -ffast-math -fno-short-enums \
42 $(ARCH)
43
44 CFLAGS += $(INCLUDE) -DARM9 -DUSING_DS
45 CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
46
47 ASFLAGS := -g $(ARCH)
48 LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -mno-fpu -Wl,-Map,$(notdir $*.map)
49
50
51 #---------------------------------------------------------------------------------
52 # no real need to edit anything past this point unless you need to add additional
53 # rules for different file extensions
54 #---------------------------------------------------------------------------------
55 #---------------------------------------------------------------------------------
56
57 OUTPUT := $(CURDIR)/$(TARGET)
58
59 VPATH :=
60
61 DEPSDIR := $(CURDIR)
62
63 CFILES :=
64 CPPFILES := dsmain.cpp \
65 hamfake.cpp \
66 ../../action.cpp \
67 ../../assert.cpp \
68 ../../ai.cpp \
69 ../../artifact.cpp \
70 ../../bmp.cpp \
71 ../../build.cpp \
72 ../../buf.cpp \
73 ../../control.cpp \
74 ../../creature.cpp \
75 ../../dpdf_table.cpp \
76 ../../encyc_support.cpp \
77 ../../gfxengine.cpp \
78 ../../grammar.cpp \
79 ../../hiscore.cpp \
80 ../../input.cpp \
81 ../../intrinsic.cpp \
82 ../../item.cpp \
83 ../../map.cpp \
84 ../../mobref.cpp \
85 ../../msg.cpp \
86 ../../name.cpp \
87 ../../piety.cpp \
88 ../../rand.cpp \
89 ../../signpost.cpp \
90 ../../smokestack.cpp \
91 ../../speed.cpp \
92 ../../sramstream.cpp \
93 ../../stylus.cpp \
94 ../../victory.cpp \
95 ../../encyclopedia.cpp \
96 ../../glbdef.cpp \
97 ../../credits.cpp \
98 ../../license.cpp \
99 ../../gfx/all_bitmaps.cpp \
100 ../../rooms/allrooms.cpp
101
102 SFILES :=
103 BINFILES :=
104
105 #---------------------------------------------------------------------------------
106 # use CXX for linking C++ projects, CC for standard C
107 #---------------------------------------------------------------------------------
108 LD := $(CXX)
109
110 OFILES := $(addsuffix .o,$(BINFILES)) \
111 $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
112
113 DEPENDS := $(OFILES:.o=.d)
114
115 #---------------------------------------------------------------------------------
116 # main targets
117 #---------------------------------------------------------------------------------
118 $(OUTPUT).ds.gba : $(OUTPUT).nds
119 # $(OUTPUT).nds : $(OUTPUT).arm9
120
121 $(OUTPUT).nds: $(OUTPUT).arm9
122 ndstool -c powder.nds -7 $(DEVKITPRO)/libnds/basic.arm7 -9 powder.arm9 -b ../../gfx/icon_nds.bmp "POWDER `cat ../../VERSION.TXT`; By Jeff Lait; "
123
124 $(OUTPUT).arm9 : $(OUTPUT).elf
125 $(OUTPUT).elf : $(OFILES)
126
127 #---------------------------------------------------------------------------------
128 %.bin.o : %.bin
129 #---------------------------------------------------------------------------------
130 @echo $(notdir $<)
131 @$(bin2o)
132
133
134 -include $(DEPENDS)
135
136 #---------------------------------------------------------------------------------
137 #---------------------------------------------------------------------------------
138 clean:
139 @echo clean ...
140 rm -f $(OFILES) $(DEPENDS) $(TARGET).elf $(TARGET).nds $(TARGET).arm9 $(TARGET).ds.gba
141