annotate Makefile @ 3:4c4be527a8d5

Send the entire state (including both pads and touch screen), and other fixes.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 18 Aug 2015 00:25:10 +0100
parents 4e831ec746e4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
1 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
2 .SUFFIXES:
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
3 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
4
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
5 ifeq ($(strip $(DEVKITARM)),)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
6 $(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
7 endif
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
8
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
9 TOPDIR ?= $(CURDIR)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
10 include $(DEVKITARM)/3ds_rules
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
11
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
12 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
13 # TARGET is the name of the output
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
14 # BUILD is the directory where object files & intermediate files will be placed
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
15 # SOURCES is a list of directories containing source code
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
16 # DATA is a list of directories containing data files
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
17 # INCLUDES is a list of directories containing header files
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
18 #
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
19 # NO_SMDH: if set to anything, no SMDH file is generated.
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
20 # APP_TITLE is the name of the app stored in the SMDH file (Optional)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
21 # APP_DESCRIPTION is the description of the app stored in the SMDH file (Optional)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
22 # APP_AUTHOR is the author of the app stored in the SMDH file (Optional)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
23 # ICON is the filename of the icon (.png), relative to the project folder.
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
24 # If not set, it attempts to use one of the following (in this order):
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
25 # - <Project name>.png
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
26 # - icon.png
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
27 # - <libctru folder>/default_icon.png
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
28 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
29 TARGET := $(notdir $(CURDIR))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
30 BUILD := build
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
31 SOURCES := source
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
32 DATA := data
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
33 INCLUDES := include
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
34
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
35 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
36 # options for code generation
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
37 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
38 ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
39
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
40 CFLAGS := -g -Wall -O2 -std=gnu11 -mword-relocations \
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
41 -fomit-frame-pointer -ffast-math \
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
42 $(ARCH)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
43
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
44 CFLAGS += $(INCLUDE) -DARM11 -D_3DS
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
45
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
46 CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
47
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
48 ASFLAGS := -g $(ARCH)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
49 LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
50
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
51 LIBS := -lctru -lm
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
52
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
53 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
54 # list of directories containing libraries, this must be the top level containing
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
55 # include and lib
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
56 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
57 LIBDIRS := $(CTRULIB)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
58
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
59
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
60 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
61 # no real need to edit anything past this point unless you need to add additional
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
62 # rules for different file extensions
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
63 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
64 ifneq ($(BUILD),$(notdir $(CURDIR)))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
65 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
66
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
67 export OUTPUT := $(CURDIR)/$(TARGET)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
68 export TOPDIR := $(CURDIR)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
69
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
70 export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
71 $(foreach dir,$(DATA),$(CURDIR)/$(dir))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
72
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
73 export DEPSDIR := $(CURDIR)/$(BUILD)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
74
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
75 CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
76 CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
77 SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
78 BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
79
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
80 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
81 # use CXX for linking C++ projects, CC for standard C
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
82 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
83 ifeq ($(strip $(CPPFILES)),)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
84 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
85 export LD := $(CC)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
86 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
87 else
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
88 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
89 export LD := $(CXX)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
90 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
91 endif
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
92 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
93
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
94 export OFILES := $(addsuffix .o,$(BINFILES)) \
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
95 $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
96
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
97 export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
98 $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
99 -I$(CURDIR)/$(BUILD)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
100
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
101 export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
102
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
103 ifeq ($(strip $(ICON)),)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
104 icons := $(wildcard *.png)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
105 ifneq (,$(findstring $(TARGET).png,$(icons)))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
106 export APP_ICON := $(TOPDIR)/$(TARGET).png
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
107 else
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
108 ifneq (,$(findstring icon.png,$(icons)))
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
109 export APP_ICON := $(TOPDIR)/icon.png
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
110 endif
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
111 endif
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
112 else
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
113 export APP_ICON := $(TOPDIR)/$(ICON)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
114 endif
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
115
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
116 .PHONY: $(BUILD) clean all
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
117
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
118 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
119 all: $(BUILD)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
120
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
121 $(BUILD):
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
122 @[ -d $@ ] || mkdir -p $@
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
123 @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
124
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
125 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
126 clean:
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
127 @echo clean ...
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
128 @rm -fr $(BUILD) $(TARGET).3dsx $(OUTPUT).smdh $(TARGET).elf
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
129
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
130
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
131 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
132 else
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
133
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
134 DEPENDS := $(OFILES:.o=.d)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
135
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
136 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
137 # main targets
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
138 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
139 ifeq ($(strip $(NO_SMDH)),)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
140 .PHONY: all
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
141 all : $(OUTPUT).3dsx $(OUTPUT).smdh
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
142 endif
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
143 $(OUTPUT).3dsx : $(OUTPUT).elf
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
144 $(OUTPUT).elf : $(OFILES)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
145
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
146 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
147 # you need a rule like this for each extension you use as binary data
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
148 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
149 %.bin.o : %.bin
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
150 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
151 @echo $(notdir $<)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
152 @$(bin2o)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
153
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
154 # WARNING: This is not the right way to do this! TODO: Do it right!
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
155 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
156 %.vsh.o : %.vsh
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
157 #---------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
158 @echo $(notdir $<)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
159 @python $(AEMSTRO)/aemstro_as.py $< ../$(notdir $<).shbin
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
160 @bin2s ../$(notdir $<).shbin | $(PREFIX)as -o $@
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
161 @echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(notdir $<).shbin | tr . _)`.h
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
162 @echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(notdir $<).shbin | tr . _)`.h
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
163 @echo "extern const u32" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(notdir $<).shbin | tr . _)`.h
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
164 @rm ../$(notdir $<).shbin
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
165
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
166 -include $(DEPENDS)
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
167
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
168 #---------------------------------------------------------------------------------------
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
169 endif
4e831ec746e4 Hello world!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
170 #---------------------------------------------------------------------------------------