Remove fried-CPU hack for the HOTEL from public code base. This hack will now live...
[freeems-vanilla.git] / src / main / Makefile
blobae734e0046162a96407bd64af662c3508caf534d
1 # FreeEMS - the open source engine management system
3 # Makefile
5 # Copyright 2008-2014 Fred Cooke
7 # This Makefile is part of the FreeEMS project.
9 # FreeEMS software is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # FreeEMS software is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with any FreeEMS software. If not, see http://www.gnu.org/licenses/
22 # We ask that if you make any changes to this file you email them upstream to
23 # us at admin(at)diyefi(dot)org or, even better, fork the code on github.com!
25 # Thank you for choosing FreeEMS to run your engine!
30 ################################################################################
31 # #
32 # About This Makefile #
33 # #
34 # This makefile incorporates many non-standard features. In particular, it #
35 # is inspired by Maven 2 and it's highly disciplined release mechanism. By #
36 # automating the release process as much as possible the chance of human #
37 # error is minimised. As much as possible, reuse is employed to keep bugs #
38 # from being introduced when changes are made. Rather than compiling from #
39 # C source files directly to object files, the build is, by default, done #
40 # in three stages, C to pre-processed C, pre-processed C to assembly, and #
41 # assembly to object files. Linking is also a little different with two #
42 # variants available, with and without garbage collection. Target device #
43 # memory usage statistics are available and generated by default when the #
44 # all target is called. Finally, extensive debug information can be #
45 # generated with a single make call. #
46 # #
47 ################################################################################
52 ################################################################################
53 # All Fixed Variables #
54 ################################################################################
57 # Constants
58 FIRMWARE_VERSION := $(shell git describe --always --dirty=-DEV)
59 OUTPREFIX := FreeEMS
60 BUILD_DATE := "$(shell date)"
61 OS := $(shell uname)
62 BUILT_BY_NAME := "$(shell git config --global --get user.name)"
63 SUPPORT_EMAIL := "$(shell git config --global --get user.email)"
65 # Windows differences
66 ifdef ComSpec
67 # Windows uses backslash
68 PATHSEP = \\
69 # Windows mkdir does not accept -p
70 MKDIR = mkdir
71 # Windows echo repeats " symbols (Q stands for quote...)
72 Q =
73 SHASUM = sha1sum
74 else
75 PATHSEP = /
76 MKDIR = mkdir -p
77 Q = "
78 SHASUM = shasum
79 endif
81 # Mac differences
82 ifeq ($(OS), Darwin)
83 MD5SUM = md5 -r
84 else
85 # If using this on windows, we're in cygwin, same as Linux
86 MD5SUM = md5sum
87 endif
89 ifdef CLIFLAGS
90 CLIBUILD = -D CLIFLAGS=1
91 ifdef XGATE
92 CLIFLAGSARG = -D $(CLIFLAGS)=1 -D XGATE=1
93 LABEL := $(OUTPREFIX)-$(FIRMWARE_VERSION)-$(CLIFLAGS)-XGATE
94 else
95 CLIFLAGSARG = -D $(CLIFLAGS)=1
96 LABEL := $(OUTPREFIX)-$(FIRMWARE_VERSION)-$(CLIFLAGS)
97 endif
98 else
99 LABEL := $(OUTPREFIX)-$(FIRMWARE_VERSION)
100 endif
102 # Directories here
103 DISTRIBUTIONDIR = ../../tmp/$(LABEL)
104 FIRMWAREDISTRIBUTIONDIR = $(DISTRIBUTIONDIR)/$(LABEL)-firmware
105 DOXYDOCDIR = ../../docs/doxygen-html
106 MAINDIR = freeems-vanilla
107 INCDIR = inc
108 DEPDIR = dependencies
109 DECDIR = decoders
110 DATADIR = initialisers
111 BUGDIR = debug
112 OUTDIR = output
113 OBJDIR = objects
114 ASMDIR = assembly
115 XGASMDIR = assemblyxgate
116 HANDASMDIR = assemblyhand
117 S19DIR = firmware
118 PPCDIR = preprocessedc
119 XGOBJDIR = $(OBJDIR)$(PATHSEP)xgate
121 # Release tag message file
122 RELTAG = $(OUTDIR)/gitTagMessage.txt
123 TAGNAME = $(OUTDIR)/gitTagName.txt
125 # Program prefixes, for the main cpu and for the xgate coprocessor
126 PREFIX = m68hc11-
127 XGPREFIX = mc9xgate-
129 # All of the tools
130 CP = cp
131 RM = rm -rf
132 ZIP = zip
133 GCC = $(PREFIX)gcc
134 COPY = $(PREFIX)objcopy
135 DUMP = $(PREFIX)objdump
136 NM = $(PREFIX)nm
137 RE = $(PREFIX)readelf
138 SIZE = $(PREFIX)size
139 XGAS = $(XGPREFIX)as
144 ################################################################################
145 # All Source Files #
146 ################################################################################
149 # Indirect dependencies that can affect everything and cause a full rebuild
150 MFILE = Makefile
151 ASMH = 9S12XDP512asm.s
152 LINKER = memory.x regions.x hc9s12xdp512elfb.x
155 # Let's keep this to a bare minimum! If you write ASM code
156 # please provide an matching alternate C implementation too.
157 HANDASMS = flashBurn.s
158 #RPMHANDASMS =
160 ALLH = $(LINKER) $(MFILE) $(INCDIR)/$(ASMH)
162 # Warning : do not include .c files from inc/ as they are
163 # included into the other C files and automatically compiled.
165 # Flash data files
166 FIXEDCLASSES = FixedConfig1.c FixedConfig2.c
167 LOOKUPCLASSES1 = IATTransferTable.c CHTTransferTable.c
168 LOOKUPCLASSES2 = MAFTransferTable.c TestTransferTable.c
169 FUELCLASSES = FuelTables.c FuelTables2.c
170 TIMECLASSES = TimingTables.c TimingTables2.c
171 TUNECLASSES = TunableConfig.c TunableConfig2.c
172 # Combined data files
173 DATARAW = $(FIXEDCLASSES) $(LOOKUPCLASSES1) $(LOOKUPCLASSES2) $(FUELCLASSES) $(TIMECLASSES) $(TUNECLASSES)
174 DATA = $(patsubst %.c,$(DATADIR)/%.c,$(DATARAW))
176 # Source code files
177 UTILCLASSES = tableLookup.c init.c utils.c globalConstants.c StaticBenchTest.c simpleGPIO.c
178 MATHCLASSES = coreVarsGenerator.c derivedVarsGenerator.c fuelAndIgnitionCalcs.c outputScheduler.c decoderInterface.c
179 COMCLASSES = flashWrite.c commsCore.c blockDetailsLookup.c
180 ISRCLASSES = interrupts.c injectionISRs.c commsISRs.c realtimeISRs.c miscISRs.c xgateVectors.c
181 # Combined source code files
182 SOURCE = freeEMS.c staticInit.c main.c $(UTILCLASSES) $(MATHCLASSES) $(COMCLASSES) $(ISRCLASSES)
184 # All but the engine position/RPM combined here
185 CLASSES = $(SOURCE) $(DATA)
187 # Engine position/RPM here
188 # Special decoders are not for use running an engine
189 RPMSPECIAL = Listener.c BenchTest.c
190 # TODO: Automate file naming for the following 4 lines
191 RPMEVENTEETH = EvenTeeth-Cam-24and1.c EvenTeeth-Cam-16and1.c EvenTeeth-Cam-6and1.c EvenTeeth-Distributor-4of6and1.c EvenTeeth-Cam-4and1.c
192 RPMMISSINGTEETH = MissingTeeth-TestFile.c MissingTeeth-Cam-24minus1.c MissingTeeth-Crank-8minus1.c MissingTeeth-Crank-12minus1.c MissingTeeth-Crank-36minus1.c MissingTeeth-Crank-60minus2.c MissingTeeth-Cam-6minus2.c MissingTeeth-Crank-30minus2.c MissingTeeth-Cam-12minus1.c MissingTeeth-Crank-36minus2.c
193 RPMHALLOROPTICAL = HallOrOptical-Distributor-4of64.c HallOrOptical-Distributor-4of69.c
194 RPMVRDISTRIBUTOR =
195 # Specific purpose per engine stuff here
196 RPMMITSISTYLE = MitsiAndMazda-CAS-4and1.c MitsiAndMazda-CAS-4and2.c
197 RPMHONDASTYLE = JSeries-12CrankWith6-2Cam.c R18A1-13CrankWith5Cam.c
198 RPMNISSANSTYLE = GM-LT1-CAS-360and8.c
199 # Insert your file above and get coding!
200 RPMSPECIFICENGINES = $(RPMMITSISTYLE) $(RPMHONDASTYLE) $(RPMNISSANSTYLE)
201 RPMCLASSESRAW = $(RPMSPECIAL) $(RPMEVENTEETH) $(RPMMISSINGTEETH) $(RPMHALLOROPTICAL) $(RPMVRDISTRIBUTOR) $(RPMSPECIFICENGINES)
202 RPMCLASSES = $(patsubst %.c,$(DECDIR)/%.c,$(RPMCLASSESRAW))
204 # XGATE stuff here!
205 XGASMSRCS = xgate.s
208 # Convert extensions
209 DEPENDENCIES = $(patsubst %.c,$(DEPDIR)/%.d,$(CLASSES))
210 DDEPENDENCIES = $(patsubst %.c,$(DEPDIR)/%.dd,$(CLASSES))
211 PREPROCESSED = $(patsubst %.c,$(PPCDIR)/%.pp.c,$(CLASSES))
212 ASSEMBLIES = $(patsubst %.c,$(ASMDIR)/%.s,$(CLASSES))
213 OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(CLASSES))
214 HANDOBJECTS = $(patsubst %.s,$(OBJDIR)/%.o,$(HANDASMS))
215 DUMPS = $(patsubst %.c,$(BUGDIR)/%.dmp,$(CLASSES)) $(patsubst %.s,$(BUGDIR)/%.dmp,$(HANDASMS))
216 XGOBJECTS = $(patsubst %.s,$(XGOBJDIR)/%.o,$(XGASMSRCS))
218 # Convert RPM extensions
219 DEPENDENCIESRPM = $(patsubst %.c,$(DEPDIR)/%.d,$(RPMCLASSES))
220 DDEPENDENCIESRPM = $(patsubst %.c,$(DEPDIR)/%.dd,$(RPMCLASSES))
221 PREPROCESSEDRPM = $(patsubst %.c,$(PPCDIR)/%.pp.c,$(RPMCLASSES))
222 ASSEMBLIESRPM = $(patsubst %.c,$(ASMDIR)/%.s,$(RPMCLASSES))
223 OBJECTSRPM = $(patsubst %.c,$(OBJDIR)/%.o,$(RPMCLASSES)) #$(patsubst $(DECDIR???)%.s,$(OBJDIR)/%.o,$(RPMHANDASMS))
224 DUMPSRPM = $(patsubst %.c,$(BUGDIR)/%.dmp,$(RPMCLASSES)) #$(patsubst $(DECDIR???)%.s,$(BUGDIR)/%.dmp,$(RPMHANDASMS))
226 # Convert to output files for source
227 ALLELFSC = $(patsubst $(DECDIR)/%.c,$(OUTDIR)/$(LABEL)-%.elf,$(RPMCLASSES))
228 ALLELFSASM = #$(patsubst %.s,$(OUTDIR)/$(LABEL)-%.elf,$(RPMHANDASMS))
229 ALLDMPSC = $(patsubst $(DECDIR)/%.c,$(BUGDIR)/$(LABEL)-%.dmp,$(RPMCLASSES))
230 ALLDMPSASM = #$(patsubst %.s,$(BUGDIR)/$(LABEL)-%.dmp,$(RPMHANDASMS))
231 ALLMAPSC = $(patsubst $(DECDIR)/%.c,$(BUGDIR)/$(LABEL)-%.map,$(RPMCLASSES))
232 ALLMAPSASM = #$(patsubst %.s,$(BUGDIR)/$(LABEL)-%.map,$(RPMHANDASMS))
233 ALLREADC = $(patsubst $(DECDIR)/%.c,$(BUGDIR)/$(LABEL)-%.ree,$(RPMCLASSES))
234 ALLREADASM = #$(patsubst %.s,$(BUGDIR)/$(LABEL)-%.ree,$(RPMHANDASMS))
235 ALLS19SC = $(patsubst $(DECDIR)/%.c,$(S19DIR)/$(LABEL)-%.s19,$(RPMCLASSES))
236 ALLS19SASM = #$(patsubst %.s,$(S19DIR)/$(LABEL)-%.s19,$(RPMHANDASMS))
238 # Convert to output files for as-is variants
239 ALLELFS = $(ALLELFSC) $(ALLELFSASM)
240 ALLDMPS = $(ALLDMPSC) $(ALLDMPSASM)
241 ALLMAPS = $(ALLMAPSC) $(ALLMAPSASM)
242 ALLREAD = $(ALLREADC) $(ALLREADASM)
243 ALLS19S = $(ALLS19SC) $(ALLS19SASM)
244 ALLSIZES = $(patsubst $(S19DIR)/%,$(OUTDIR)/%.txt,$(ALLS19S))
245 ALLDUMMY = $(patsubst $(S19DIR)/%,$(OUTDIR)/%.txt.dummy,$(ALLS19S))
246 ALLMD5S = $(patsubst $(S19DIR)/%,$(FIRMWAREDISTRIBUTIONDIR)/%.md5,$(ALLS19S))
247 ALLSHA1S = $(patsubst $(S19DIR)/%,$(FIRMWAREDISTRIBUTIONDIR)/%.sha1,$(ALLS19S))
248 ALLS19ZIPS = $(patsubst $(S19DIR)/%,$(FIRMWAREDISTRIBUTIONDIR)/%.zip,$(ALLS19S))
251 # Convert to output files for GC variants
252 GCDELFSC = $(patsubst $(DECDIR)/%.c,$(OUTDIR)/$(LABEL)-%.gc.elf,$(RPMCLASSES))
253 GCDELFSASM = #$(patsubst %.s,$(OUTDIR)/$(LABEL)-%.gc.elf,$(RPMHANDASMS))
254 GCDS19SC = $(patsubst $(DECDIR)/%.c,$(S19DIR)/$(LABEL)-%.gc.s19,$(RPMCLASSES))
255 GCDS19SASM = #$(patsubst %.s,$(S19DIR)/$(LABEL)-%.gc.s19,$(RPMHANDASMS))
256 GCDELFS = $(GCDELFSC) $(GCDELFSASM)
257 GCDS19S = $(GCDS19SC) $(GCDELFSASM)
258 GCDSIZES = $(patsubst $(S19DIR)/%,$(OUTDIR)/%.txt,$(GCDS19S))
259 GCDDUMMY = $(patsubst $(S19DIR)/%,$(OUTDIR)/%.txt.dummy,$(GCDS19S))
264 ################################################################################
265 # All Command Line Options #
266 ################################################################################
269 # M68hc1x GCC Options we may want : -minmax -mlong-calls
271 # http://www.gnu.org/software/m68hc11/m68hc11_gcc.html shows code size with different options used
272 # include debug info, optimise , 16 bit ints, hcs12 platform
273 GCCOPTS1 = -Wall -Werror -Winline -O -m68hcs12 -mshort -ffunction-sections
274 GCCOPTS2 = -fomit-frame-pointer -msoft-reg-count=8 -mauto-incdec -fsigned-char
275 GCCOPTS = $(GCCOPTS1) $(GCCOPTS2) $(CLIBUILD) $(CLIFLAGSARG) -D SUPPORT_EMAIL=\"$(SUPPORT_EMAIL)\" -D BUILT_BY_NAME=\"$(BUILT_BY_NAME)\" -D FIRMWARE_VERSION=\"$(FIRMWARE_VERSION)\" -D FIRMWARE_BUILD_DATE=\"$(BUILD_DATE)\" -D OPERATING_SYSTEM=\"$(OS)\"
276 # -ffunction-sections option splits out the functions such that the garbage collection can get
277 # them on a per section basis. I'm not sure, but this could be harmful to paged code so may
278 # have to review this at a later date perhaps splitting paged functions from nonpaged ones.
280 # pass to linker, link for hc12
281 # The vectors address in the linker options is the VMA address and must be short form 0xF710, not a paged address.
282 LINKOPTS = -no-warn-mismatch,-defsym,vectors_addr=0xF710,-m,m68hc12elfb,-T,hc9s12xdp512elfb.x
283 LINKOPTSGC = -no-warn-mismatch,--gc-sections,--print-gc-sections,-defsym,vectors_addr=0xF710,-m,m68hc12elfb,-T,hc9s12xdp512elfb.x
284 # Use this to get a map dump when the linker fails in a confusing way : --print-map
286 # If using the below option for paged flash, the ADDRESS_TYPE
287 # field in the freeEMSloader script should be updated to match.
288 COPYOPTS = --output-target=srec \
289 --change-section-lma .fixedconf1+0xFD4000 \
290 --change-section-lma .fixedconf2+0xFD4000 \
291 --change-section-lma .text1+0xFD4000 \
292 --change-section-lma .text+0xFEC000 \
293 --change-section-lma .data+0xFEC000 \
294 --change-section-lma .vectors+0xFEC000 \
295 --change-section-lma .rodata+0xFEC000 \
296 --only-section=.fixedconf1 \
297 --only-section=.fixedconf2 \
298 --only-section=.text \
299 --only-section=.text1 \
300 --only-section=.data \
301 --only-section=.vectors \
302 --only-section=.rodata \
303 --change-section-lma .ppageE0X=0xE08800 \
304 --change-section-lma .ppageE1=0xE18000 \
305 --only-section=.ppageE0X \
306 --only-section=.ppageE1 \
307 --set-section-flags .ppageE1=alloc,load \
308 --change-section-lma .ppageF8=0xF88000 \
309 --change-section-lma .fpageF9=0xF98000 \
310 --change-section-lma .dpageF9=0xF9A000 \
311 --change-section-lma .ppageFE=0xFE8000 \
312 --only-section=.ppageF8 \
313 --only-section=.fpageF9 \
314 --only-section=.dpageF9 \
315 --only-section=.ppageFE \
316 --change-section-lma .fpageFA=0xFA8000 \
317 --change-section-lma .dpageFA=0xFAA000 \
318 --change-section-lma .fpageFB=0xFB8000 \
319 --change-section-lma .dpageFB1=0xFBA000 \
320 --change-section-lma .dpageFB2=0xFBA400 \
321 --change-section-lma .dpageFB3=0xFBA800 \
322 --change-section-lma .dpageFB4=0xFBAC00 \
323 --change-section-lma .dpageFB5=0xFBB000 \
324 --change-section-lma .dpageFB6=0xFBB400 \
325 --change-section-lma .dpageFB7=0xFBB800 \
326 --change-section-lma .dpageFB8=0xFBBC00 \
327 --change-section-lma .fpageFC=0xFC8000 \
328 --change-section-lma .dpageFC=0xFCA000 \
329 --only-section=.dpageFA \
330 --only-section=.fpageFA \
331 --only-section=.dpageFB1 \
332 --only-section=.dpageFB2 \
333 --only-section=.dpageFB3 \
334 --only-section=.dpageFB4 \
335 --only-section=.dpageFB5 \
336 --only-section=.dpageFB6 \
337 --only-section=.dpageFB7 \
338 --only-section=.dpageFB8 \
339 --only-section=.fpageFB \
340 --only-section=.dpageFC \
341 --only-section=.fpageFC
342 # --change-section-lma .ppageFD=0xFD8000 \
343 # --change-section-lma .ppageFF=0xFF8000 \
344 # --only-section=.ppageFD \ This is left here for clarity only (equivalent to text1 but paged)
345 # --only-section=.ppageFF This is left here for clarity only (equivalent to text but paged)
346 # Changes to the above options should be reflected in memory.x and memory.h also!
348 # The following flash areas should only be included if they are used.
349 # --only-section=.ppageE0S \
350 # --only-section=.ppageE2 \
351 # --only-section=.ppageE3 \
352 # --only-section=.ppageE4 \
353 # --only-section=.ppageE5 \
354 # --only-section=.ppageE6 \
355 # --only-section=.ppageE7 \
356 # --only-section=.ppageE8 \
357 # --only-section=.ppageE9 \
358 # --only-section=.ppageEA \
359 # --only-section=.ppageEB \
360 # --only-section=.ppageEC \
361 # --only-section=.ppageED \
362 # --only-section=.ppageEE \
363 # --only-section=.ppageEF \
364 # --only-section=.ppageF0 \
365 # --only-section=.ppageF1 \
366 # --only-section=.ppageF2 \
367 # --only-section=.ppageF3 \
368 # --only-section=.ppageF4 \
369 # --only-section=.ppageF5 \
370 # --only-section=.ppageF6 \
371 # --only-section=.ppageF7 \
372 # --change-section-lma .ppageE0S=0xE08000 \
373 # --change-section-lma .ppageE2=0xE28000 \
374 # --change-section-lma .ppageE3=0xE38000 \
375 # --change-section-lma .ppageE4=0xE48000 \
376 # --change-section-lma .ppageE5=0xE58000 \
377 # --change-section-lma .ppageE6=0xE68000 \
378 # --change-section-lma .ppageE7=0xE78000 \
379 # --change-section-lma .ppageE8=0xE88000 \
380 # --change-section-lma .ppageE9=0xE98000 \
381 # --change-section-lma .ppageEA=0xEA8000 \
382 # --change-section-lma .ppageEB=0xEB8000 \
383 # --change-section-lma .ppageEC=0xEC8000 \
384 # --change-section-lma .ppageED=0xED8000 \
385 # --change-section-lma .ppageEE=0xEE8000 \
386 # --change-section-lma .ppageEF=0xEF8000 \
387 # --change-section-lma .ppageF0=0xF08000 \
388 # --change-section-lma .ppageF1=0xF18000 \
389 # --change-section-lma .ppageF2=0xF28000 \
390 # --change-section-lma .ppageF3=0xF38000 \
391 # --change-section-lma .ppageF4=0xF48000 \
392 # --change-section-lma .ppageF5=0xF58000 \
393 # --change-section-lma .ppageF6=0xF68000 \
394 # --change-section-lma .ppageF7=0xF78000 \
399 help:
400 @echo $(Q)################################################################################$(Q)
401 @echo $(Q)# Dependency And Target Summary #$(Q)
402 @echo $(Q)################################################################################$(Q)
403 @echo $(Q)# #$(Q)
404 @echo $(Q)# Common targets: #$(Q)
405 @echo $(Q)# #$(Q)
406 @echo $(Q)# 1) help - This comment block #$(Q)
407 @echo $(Q)# 2) all - Executes alldebug, slow, slowgc and size #$(Q)
408 @echo $(Q)# 3) dirs - Creates all of the directories required to build #$(Q)
409 @echo $(Q)# 5) slow - Three stage compilation with assembly retained #$(Q)
410 @echo $(Q)# 6) slowgc - As above, but with garbage collection during linking #$(Q)
411 @echo $(Q)# 7) alldebug - Generates all debug output files #$(Q)
412 @echo $(Q)# 8) install - Not yet implemented #$(Q)
413 @echo $(Q)# 9) release - Performs a full release build #$(Q)
414 @echo $(Q)# 10) clean - Removes all files and directories generated by building #$(Q)
415 @echo $(Q)# #$(Q)
416 @echo $(Q)# Second level targets: #$(Q)
417 @echo $(Q)# #$(Q)
418 @echo $(Q)# Stage one: #$(Q)
419 @echo $(Q)# #$(Q)
420 @echo $(Q)# 1) preprocess - run the C preprocessor over the raw C files #$(Q)
421 @echo $(Q)# 2) compile - compile the preprocessed C into assembly #$(Q)
422 @echo $(Q)# 3) assemble - assemble the assembly files into object files #$(Q)
423 @echo $(Q)# #$(Q)
424 @echo $(Q)# Stage two #$(Q)
425 @echo $(Q)# #$(Q)
426 @echo $(Q)# 1) link - Generate ELFs objects #$(Q)
427 @echo $(Q)# 2) gclink - As above, but with garbage collection #$(Q)
428 @echo $(Q)# 3) s19 - Create s19s from elfs #$(Q)
429 @echo $(Q)# 4) gcs19 - Create s19s from gc elfs #$(Q)
430 @echo $(Q)# 5) sizes - Calculate the approximate s19 sizes #$(Q)
431 @echo $(Q)# 6) gcsizes - Calculate the approximate gc s19 sizes #$(Q)
432 @echo $(Q)# #$(Q)
433 @echo $(Q)# Stage three: #$(Q)
434 @echo $(Q)# #$(Q)
435 @echo $(Q)# 1) maps - Memory map files #$(Q)
436 @echo $(Q)# 2) rees - Readelf dumps #$(Q)
437 @echo $(Q)# 3) elfdmps - Classic objdump output for final elfs #$(Q)
438 @echo $(Q)# 4) objdmps - Classic objdump output for each object file #$(Q)
439 @echo $(Q)# #$(Q)
440 @echo $(Q)# When doing a full build the following steps are taken: #$(Q)
441 @echo $(Q)# #$(Q)
442 @echo $(Q)# 1) Pre-process all of the C files #$(Q)
443 @echo $(Q)# 2) Compile all preprocessed C files into assembly files #$(Q)
444 @echo $(Q)# 3) Assemble all assembly files into object files #$(Q)
445 @echo $(Q)# 4) Link each decoder without garbage collection #$(Q)
446 @echo $(Q)# 5) Produce a memory map for each elf #$(Q)
447 @echo $(Q)# 6) Produce a readelf dump for each elf #$(Q)
448 @echo $(Q)# 7) Dump the contents of each decoders elf #$(Q)
449 @echo $(Q)# 8) Dump the contents of all object files #$(Q)
450 @echo $(Q)# 9) Link each decoder with garbage collection and reporting turned on #$(Q)
451 @echo $(Q)# 10) Produce an s19 loadable firmware file for each elf #$(Q)
452 @echo $(Q)# 11) Measure each binary image approximately #$(Q)
453 @echo $(Q)# 12) Measure each decoder object file #$(Q)
454 @echo $(Q)# 13) Measure each other object file and summarise #$(Q)
455 @echo $(Q)# #$(Q)
456 @echo $(Q)# The release target: #$(Q)
457 @echo $(Q)# #$(Q)
458 @echo $(Q)# This target is purely for use by lead developers to produce a file set #$(Q)
459 @echo $(Q)# that is suitable for release and distribution to users and interested #$(Q)
460 @echo $(Q)# parties. The steps performed are listed below: #$(Q)
461 @echo $(Q)# #$(Q)
462 @echo $(Q)# 1) Checks that the repository is consistent #$(Q)
463 @echo $(Q)# 2) Performs a full clean #$(Q)
464 @echo $(Q)# 4) Removes the doxygen files #$(Q)
465 @echo $(Q)# 5) Builds binaries for each decoder type #$(Q)
466 @echo $(Q)# 7) Generates a new doxygen site #$(Q)
467 @echo $(Q)# 8) Performs a full clean #$(Q)
468 @echo $(Q)# 9) Commits the release files #$(Q)
469 @echo $(Q)# 10) Asks for a tag name and tag message #$(Q)
470 @echo $(Q)# 11) Tags the release at the automatic commit point #$(Q)
471 @echo $(Q)# 12) Generates md5 and sha1 checksums into the distribution directory #$(Q)
472 @echo $(Q)# 13) Zips the binaries into the distribution directory #$(Q)
473 @echo $(Q)# 14) Zips the doxygen site into the distribution directory #$(Q)
474 @echo $(Q)# 15) Zips the documentation into the distribution directory #$(Q)
475 @echo $(Q)# 16) Zips the repository into the distribution directory #$(Q)
476 @echo $(Q)# 17) Zips the source code into the distribution directory #$(Q)
477 @echo $(Q)# #$(Q)
478 @echo $(Q)# At that point the developer in charge of release has only to upload #$(Q)
479 @echo $(Q)# the files found in the distribution directory to appropriate locations #$(Q)
480 @echo $(Q)# and publicise the fact that a new release has been performed! This #$(Q)
481 @echo $(Q)# automation removes most opportunity for mistakes and makes release #$(Q)
482 @echo $(Q)# quality consistent between each successive release cycle! #$(Q)
483 @echo $(Q)# #$(Q)
484 @echo $(Q)# Unlisted targets: #$(Q)
485 @echo $(Q)# #$(Q)
486 @echo $(Q)# Additionally any of the output files can be used as a target directly. #$(Q)
487 @echo $(Q)# This is perfect for building only what is required for a specific s19. #$(Q)
488 @echo $(Q)# It is also perfect for working with a single file as you don't have to #$(Q)
489 @echo $(Q)# wait for other unrelated things to build first nor do you have to wait #$(Q)
490 @echo $(Q)# for other files to continue building after yours is successful. Before #$(Q)
491 @echo $(Q)# using individual output files for targets, please run 'make dirs'. #$(Q)
492 @echo $(Q)# #$(Q)
493 @echo $(Q)# Common goals: #$(Q)
494 @echo $(Q)# #$(Q)
495 @echo $(Q)# You most likely just want to run \"make s19\" or \"make clean\", do that! #$(Q)
496 @echo $(Q)# #$(Q)
497 @echo $(Q)# To build with a specific compiled in configuration do this instead: #$(Q)
498 @echo $(Q)# #$(Q)
499 @echo $(Q)# CLIFLAGS=\"YOURBUILDNAME\" make clean s19 #$(Q)
500 @echo $(Q)# #$(Q)
501 @echo $(Q)################################################################################$(Q)
506 ################################################################################
507 # Single Decoder Builds #
508 ################################################################################
511 Listener: $(S19DIR)/$(LABEL)-Listener.s19
512 BenchTest: $(S19DIR)/$(LABEL)-BenchTest.s19
513 EvenTeeth-Cam-24and1: $(S19DIR)/$(LABEL)-EvenTeeth-Cam-24and1.s19
514 EvenTeeth-Cam-16and1: $(S19DIR)/$(LABEL)-EvenTeeth-Cam-16and1.s19
515 EvenTeeth-Cam-6and1: $(S19DIR)/$(LABEL)-EvenTeeth-Cam-6and1.s19
516 EvenTeeth-Cam-4and1: $(S19DIR)/$(LABEL)-EvenTeeth-Cam-4and1.s19
517 MissingTeeth-Crank-8minus1: $(S19DIR)/$(LABEL)-MissingTeeth-Crank-8minus1.s19
518 MissingTeeth-Crank-12minus1: $(S19DIR)/$(LABEL)-MissingTeeth-Crank-12minus1.s19
519 MissingTeeth-Cam-12minus1: $(S19DIR)/$(LABEL)-MissingTeeth-Cam-12minus1.s19
520 HallOrOptical-Distributor-4of69: $(S19DIR)/$(LABEL)-HallOrOptical-Distributor-4of69.s19
521 MitsiAndMazda-CAS-4and1: $(S19DIR)/$(LABEL)-MitsiAndMazda-CAS-4and1.s19
522 MitsiAndMazda-CAS-4and2: $(S19DIR)/$(LABEL)-MitsiAndMazda-CAS-4and2.s19
523 GM-LT1-CAS-360and8: $(S19DIR)/$(LABEL)-GM-LT1-CAS-360and8.s19
524 JSeries-12CrankWith6-2Cam: $(S19DIR)/$(LABEL)-JSeries-12CrankWith6-2Cam.s19
525 EvenTeeth-Distributor-4of6and1: $(S19DIR)/$(LABEL)-EvenTeeth-Distributor-4of6and1.s19
526 MissingTeeth-Crank-36minus2: $(S19DIR)/$(LABEL)-MissingTeeth-Crank-36minus2.s19
527 R18A1-13CrankWith5Cam: $(S19DIR)/$(LABEL)-R18A1-13CrankWith5Cam.s19
532 ################################################################################
533 # Generated Dependencies #
534 ################################################################################
537 # Bring in all of the generated deps. Note, if these fail on the first pass of parsing, Make will generate them and reparse.
538 -include $(DEPENDENCIES) $(DEPENDENCIESRPM) $(DDEPENDENCIES) $(DDEPENDENCIESRPM)
543 ################################################################################
544 # All Target Dependencies #
545 ################################################################################
548 # Build everything the long way
549 all: alldebug gcsizes sizes size
550 # Multi stage compilation
551 slow: sizes size
552 # Multi stage compilation with garbage collection
553 slowgc: gcsizes size
554 # Clean all except release
555 clean: cleandep cleanasm cleanobj cleanout cleanppc cleans19 cleandebug
556 # Generate all debug
557 alldebug: maps rees elfdmps objdmps
558 # Load the s19 of your choice
559 #install: clean slow loader
560 # Perform a release
561 release: testgit relbuildfull tagrelease
562 package: relbuildfull relpack1 relpack2 zipsite
563 publish: package deploydoxy deploy
564 publishnodoxy: packagenodoxy deploy
565 packagenodoxy: relbuildfirmware relpack1 relpack2
566 relbuildfull: clean cleandoxy gendoxy s19
567 relbuildfirmware: clean s19
568 relpack1: md5sums sha1sums s19zips
569 relpack2: zipdocs zipmain zipsrc
572 # Force dates and versions to be up to date
573 $(PPCDIR)/globalConstants.pp.c: .FORCE
574 .FORCE:
577 ################################################################################
578 # Debug Target Definitions #
579 ################################################################################
582 mapsmsg:
583 @echo $(Q)################################################################################$(Q)
584 @echo $(Q)# Generating memory maps.... #$(Q)
585 @echo $(Q)################################################################################$(Q)
587 maps: link mapsmsg $(ALLMAPS)
589 $(BUGDIR)/%.map: $(OUTDIR)/%.elf $(BUGDIR)
590 $(NM) $< | sort > $@
593 reesmsg:
594 @echo $(Q)################################################################################$(Q)
595 @echo $(Q)# Reading all elf files... #$(Q)
596 @echo $(Q)################################################################################$(Q)
598 rees: link reesmsg $(ALLREAD)
600 $(BUGDIR)/%.ree: $(OUTDIR)/%.elf $(BUGDIR)
601 $(RE) -a -W $< > $@
604 elfdmpsmsg:
605 @echo $(Q)################################################################################$(Q)
606 @echo $(Q)# Dumping all elf files... #$(Q)
607 @echo $(Q)################################################################################$(Q)
609 elfdmps: link elfdmpsmsg $(ALLDMPS)
611 $(BUGDIR)/%.dmp: $(OUTDIR)/%.elf $(BUGDIR)
612 $(DUMP) -spSd $< > $@
615 objdmpmsg:
616 @echo $(Q)################################################################################$(Q)
617 @echo $(Q)# Dumping all object files.... #$(Q)
618 @echo $(Q)################################################################################$(Q)
620 objdmps: assemble objdmpmsg $(DUMPS) $(DUMPSRPM)
622 $(BUGDIR)/%.dmp: $(OBJDIR)/%.o $(BUGDIR)
623 $(DUMP) -spSd $< > $@
628 ################################################################################
629 # Link and Copy Target Definitions #
630 ################################################################################
633 linkmsg:
634 @echo $(Q)################################################################################$(Q)
635 @echo $(Q)# Linking the Objects into an ELF... #$(Q)
636 @echo $(Q)################################################################################$(Q)
638 link: assemble linkmsg $(ALLELFS)
640 # link the object files into an elf executable
641 $(OUTDIR)/$(LABEL)-%.elf: $(OBJDIR)/$(DECDIR)/%.o $(OBJECTS) $(HANDOBJECTS) $(XGOBJECTS) $(OUTDIR)
642 @echo $(Q)################################################################################$(Q)
643 @echo $(Q)# Linking $@ ...$(Q)
644 @echo $(Q)################################################################################$(Q)
645 $(GCC) $(GCCOPTS) -Wl,$(LINKOPTS) -o $@ $(OBJECTS) $(HANDOBJECTS) $(XGOBJECTS) $<
648 gclinkmsg:
649 @echo $(Q)################################################################################$(Q)
650 @echo $(Q)# Linking the Objects into an ELF... #$(Q)
651 @echo $(Q)################################################################################$(Q)
653 gclink: assemble linkmsg $(GCDELFS)
655 # link the object files into an elf executable with gc enabled
656 $(OUTDIR)/$(LABEL)-%.gc.elf: $(OBJDIR)/$(DECDIR)/%.o $(OBJECTS) $(HANDOBJECTS) $(XGOBJECTS) $(OUTDIR)
657 @echo $(Q)################################################################################$(Q)
658 @echo $(Q)# Linking $@ ...$(Q)
659 @echo $(Q)################################################################################$(Q)
660 $(GCC) $(GCCOPTS) -Wl,$(LINKOPTSGC) -o $@ $(OBJECTS) $(HANDOBJECTS) $(XGOBJECTS) $<
661 # The links with garbage collection are to ensure that there are no warnings
662 # TODO find out how to stop .tramp from being collected (or inserted)!
663 # This will be the only way once Sean's stuff is done and distributed, I can't wait to cut all this bullshit out!
666 s19msg:
667 @echo $(Q)################################################################################$(Q)
668 @echo $(Q)# Building The S19 Files.... #$(Q)
669 @echo $(Q)################################################################################$(Q)
671 s19: link s19msg $(ALLS19S)
672 # the gc dependency is temporary until i figure out if the .tramp removal is an issue or not.
674 # Generate the loadable s19 firmware files
675 $(S19DIR)/%.s19: $(OUTDIR)/%.elf $(S19DIR)
676 @echo $(Q)################################################################################$(Q)
677 @echo $(Q)# Building $(@F) ...$(Q)
678 @echo $(Q)################################################################################$(Q)
679 $(COPY) $(COPYOPTS) $< $(@F)
680 mv $(@F) $@
683 sizesmsg:
684 @echo $(Q)################################################################################$(Q)
685 @echo $(Q)# Measuring The S19 Files... #$(Q)
686 @echo $(Q)################################################################################$(Q)
688 sizes: s19 sizesmsg $(ALLSIZES) $(ALLDUMMY)
691 # Roughly measure the s19 sizes
692 $(OUTDIR)/%.txt: $(S19DIR)/% $(OUTDIR)
693 echo $(shell cat $< | wc -l) $(Q)* 16$(Q) > $@
695 # Have to do this in two stages to allow $(shell exp) use and portability to windows
696 $(OUTDIR)/%.dummy: $(OUTDIR)/% $(OUTDIR)
697 echo $(Q)Flash image size is$(Q) $(shell cat $< | bc -l) $(Q)bytes for $<$(Q)
700 gcs19msg:
701 @echo $(Q)################################################################################$(Q)
702 @echo $(Q)# Building The GC S19 Files.... #$(Q)
703 @echo $(Q)################################################################################$(Q)
705 gcs19: gclink gcs19msg $(GCDS19S)
707 # Generate the garbage collected s19 files temporarily
708 $(S19DIR)/%.s19: $(OUTDIR)/%.elf $(S19DIR)
709 @echo $(Q)################################################################################$(Q)
710 @echo $(Q)# Building $(@F) ...$(Q)
711 @echo $(Q)################################################################################$(Q)
712 $(COPY) $(COPYOPTS) $< $(@F)
713 mv $(@F) $@
715 gcsizesmsg:
716 @echo $(Q)################################################################################$(Q)
717 @echo $(Q)# Measuring The GC S19 Files... #$(Q)
718 @echo $(Q)################################################################################$(Q)
720 gcsizes: gcs19 gcsizesmsg $(GCDSIZES) $(GCDDUMMY)
722 # Roughly measure the gc s19 sizes
723 $(OUTDIR)/%.txt: $(S19DIR)/% $(OUTDIR)
724 @echo $(shell cat $< | wc -l) $(Q)* 16$(Q) > $@
726 # Have to do this in two stages to allow $(shell exp) use and portability to windows
727 $(OUTDIR)/%.dummy: $(OUTDIR)/% $(OUTDIR)
728 @echo $(Q)Flash image size is$(Q) $(shell cat $< | bc -l) $(Q)bytes for $<$(Q)
734 ################################################################################
735 # Size Measuring Target Definition #
736 ################################################################################
739 size: assemble # TODO this should be run for each s19 target with only the one rpm .o file
740 @echo $(Q)################################################################################$(Q)
741 @echo $(Q)# Measuring The Decoder Binaries... #$(Q)
742 @echo $(Q)################################################################################$(Q)
743 $(SIZE) $(OBJECTSRPM)
744 @echo $(Q)################################################################################$(Q)
745 @echo $(Q)# Measuring All Other Binaries... #$(Q)
746 @echo $(Q)################################################################################$(Q)
747 $(SIZE) -t $(OBJECTS)
748 @echo $(Q)################################################################################$(Q)
749 @echo $(Q)# Add one decoder to the total above and #$(Q)
750 @echo $(Q)# subtract the size reported for freeEMS.o #$(Q)
751 @echo $(Q)# this will give you the actual image size #$(Q)
752 @echo $(Q)################################################################################$(Q)
753 @echo $(Q)# #$(Q)
754 @echo $(Q)# Thank you for building FreeEMS firmware!!! #$(Q)
755 @echo $(Q)# #$(Q)
756 @echo $(Q)################################################################################$(Q)
761 ################################################################################
762 # Preprocess, Compile and Assemble Target Definitions #
763 ################################################################################
766 dependenciesmsg:
767 @echo $(Q)################################################################################$(Q)
768 @echo $(Q)# Generating the dependencies... #$(Q)
769 @echo $(Q)################################################################################$(Q)
771 dependencies: dependenciesmsg $(DEPENDENCIES) $(DEPENDENCIESRPM) $(DDEPENDENCIES) $(DDEPENDENCIESRPM)
773 # Generate dependency files for recompilation on change semantics
774 $(DEPENDENCIES) $(DEPENDENCIESRPM): $(DEPDIR)/%.d: %.c $(ALLH)
775 $(GCC) $(CLIBUILD) $(CLIFLAGSARG) -MM -MF $@ -MT $(PPCDIR)/$*.pp.c $<
776 # Generate dependency files for the dependency files...
777 $(DDEPENDENCIES) $(DDEPENDENCIESRPM): $(DEPDIR)/%.dd: %.c $(ALLH)
778 $(GCC) $(CLIBUILD) $(CLIFLAGSARG) -MM -MF $@ -MT $(DEPDIR)/$*.d $<
781 preprocessmsg:
782 @echo $(Q)################################################################################$(Q)
783 @echo $(Q)# Running the C Pre Processor... #$(Q)
784 @echo $(Q)################################################################################$(Q)
786 preprocess: preprocessmsg $(PREPROCESSED) $(PREPROCESSEDRPM)
788 # Generate preprocessed source files to examine
789 $(PPCDIR)/%.pp.c: %.c $(ALLH) $(PPCDIR)
790 $(GCC) $(GCCOPTS) -D BASE_FILE_NAME=\"$(*F)\" -E $< > $@
791 $(PPCDIR)/decoders/%.pp.c: decoders/%.c $(ALLH) $(PPCDIR)
792 $(GCC) $(GCCOPTS) -D BASE_FILE_NAME=\"$(*F)\" -E $< > $@
795 compilemsg:
796 @echo $(Q)################################################################################$(Q)
797 @echo $(Q)# Compiling PPC to Assembly... #$(Q)
798 @echo $(Q)################################################################################$(Q)
800 compile: preprocess compilemsg $(ASSEMBLIES) $(ASSEMBLIESRPM)
802 # Generate assembly files to examine
803 $(ASMDIR)/%.s: $(PPCDIR)/%.pp.c $(ASMDIR)
804 $(GCC) -g $(GCCOPTS) -x cpp-output -S -o $@ $<
807 assemblemsg:
808 @echo $(Q)################################################################################$(Q)
809 @echo $(Q)# Assembling Object Files... #$(Q)
810 @echo $(Q)################################################################################$(Q)
812 assemble: compile assemblemsg $(OBJECTS) $(HANDOBJECTS) $(OBJECTSRPM) $(XGOBJECTS)
814 # Generate object files to link
815 $(OBJDIR)/%.o: $(ASMDIR)/%.s $(OBJDIR)
816 $(GCC) $(GCCOPTS) -c -o $@ $<
818 $(OBJDIR)/%.o: $(HANDASMDIR)/%.s $(OBJDIR)
819 $(GCC) -g $(GCCOPTS) -c -o $@ $<
821 $(XGOBJDIR)/%.o: $(XGASMDIR)/%.s $(XGOBJDIR)
822 $(XGAS) -o $@ $<
826 ################################################################################
827 # Release Procedure Target Definitions #
828 ################################################################################
831 # Debian only :-p
832 testgit:
833 @echo "################################################################################"
834 @echo "# Checking git status... #"
835 @echo "################################################################################"
836 @echo "Are we on master?"
837 test `git symbolic-ref HEAD` = refs/heads/master
838 @echo "Is everything checked in?"
839 test `git status -s | wc -l` -eq 0
840 @echo "Fetching from origin..."
841 git fetch
842 @echo "Are we behind?"
843 test `git rev-list \`git show-ref --hash refs/heads/master\`..\`git show-ref --hash refs/remotes/origin/master\` | wc -l` -eq 0
844 @echo "Are we ahead?"
845 test `git rev-list \`git show-ref --hash refs/remotes/origin/master\`..\`git show-ref --hash refs/heads/master\` | wc -l` -eq 0
848 md5sumsmsg:
849 @echo $(Q)################################################################################$(Q)
850 @echo $(Q)# Generating MD5 Sums... #$(Q)
851 @echo $(Q)################################################################################$(Q)
853 md5sums: s19 md5sumsmsg $(ALLMD5S)
855 $(FIRMWAREDISTRIBUTIONDIR)/%.s19.md5: $(S19DIR)/%.s19 distributiondir
856 $(MD5SUM) $< > $@
859 sha1sumsmsg:
860 @echo $(Q)################################################################################$(Q)
861 @echo $(Q)# Generating SHA1 Sums... #$(Q)
862 @echo $(Q)################################################################################$(Q)
864 sha1sums: s19 sha1sumsmsg $(ALLSHA1S)
866 $(FIRMWAREDISTRIBUTIONDIR)/%.s19.sha1: $(S19DIR)/%.s19 distributiondir
867 $(SHASUM) $< > $@
872 s19zipsmsg:
873 @echo $(Q)################################################################################$(Q)
874 @echo $(Q)# Zipping S19s... #$(Q)
875 @echo $(Q)################################################################################$(Q)
877 s19zips: s19 s19zipsmsg $(ALLS19ZIPS)
879 $(FIRMWAREDISTRIBUTIONDIR)/%.s19.zip: $(S19DIR)/%.s19 distributiondir
880 zip -j $@ $<
883 tagmessage:
884 vim $(RELTAG)
886 tagname:
887 vim $(TAGNAME)
890 tagrelease: tagname tagmessage
891 git tag -F $(RELTAG) `cat $(TAGNAME)` HEAD
894 zipmain: distributiondir
895 cd ../../ ; git archive --format=zip --prefix=$(LABEL)/ HEAD > ./tmp/$(DISTRIBUTIONDIR)/$(LABEL)-full.zip;cd -
897 zipdocs: distributiondir
898 cd ../../ ; git archive --format=zip --prefix=$(LABEL)- HEAD docs/ > ./tmp/$(DISTRIBUTIONDIR)/$(LABEL)-docs.zip;cd -
900 gendoxy: clean
901 cd ../../ ; ( cat docs/Doxyfile ; echo "PROJECT_NUMBER=$(FIRMWARE_VERSION)" ) | doxygen - | grep Warning > src/doxygen.output;cd -
903 zipsite: distributiondir gendoxy
904 cd ../../docs/ ; zip -r $(DISTRIBUTIONDIR)/$(LABEL)-doxygen-html.zip doxygen-html/;cd -
906 zipsrc: distributiondir
907 cd ../../ ; git archive --format=zip --prefix=$(LABEL)- HEAD src/ > ./tmp/$(DISTRIBUTIONDIR)/$(LABEL)-src.zip;cd -
909 deploy: distributiondir
910 scp -r $(DISTRIBUTIONDIR) raptor:/home/firmware/releases/
912 deploydoxy: zipsite
913 scp -r $(DISTRIBUTIONDIR)/$(LABEL)-doxygen-html.zip raptor:/home/docs/releases/
914 ssh raptor unzip /home/docs/releases/$(LABEL)-doxygen-html.zip -d /home/docs/releases/
915 ssh raptor mv /home/docs/releases/doxygen-html/ /home/docs/releases/$(FIRMWARE_VERSION)
920 ################################################################################
921 # Create Directory Target Definitions #
922 ################################################################################
924 # Assembly, release and inc directories don't get removed.
926 dirs: $(BUGDIR) $(S19DIR) $(PPCDIR) $(OUTDIR) $(OBJDIR) $(XGOBJDIR) $(ASMDIR)
928 $(BUGDIR):
929 @echo $(Q)################################################################################$(Q)
930 @echo $(Q)# Creating the debug directory.... #$(Q)
931 @echo $(Q)################################################################################$(Q)
932 $(MKDIR) $(BUGDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
933 rmdir $(BUGDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
934 $(MKDIR) $(BUGDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
935 rmdir $(BUGDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
937 $(S19DIR):
938 @echo $(Q)################################################################################$(Q)
939 @echo $(Q)# Creating the firmware directory... #$(Q)
940 @echo $(Q)################################################################################$(Q)
941 $(MKDIR) $(S19DIR)$(PATHSEP)hack
942 rmdir $(S19DIR)$(PATHSEP)hack
944 $(PPCDIR):
945 @echo $(Q)################################################################################$(Q)
946 @echo $(Q)# Creating the preprocessedc directory.... #$(Q)
947 @echo $(Q)################################################################################$(Q)
948 $(MKDIR) $(PPCDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
949 rmdir $(PPCDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
950 $(MKDIR) $(PPCDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
951 rmdir $(PPCDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
953 $(ASMDIR):
954 @echo $(Q)################################################################################$(Q)
955 @echo $(Q)# Creating the assembly directory... #$(Q)
956 @echo $(Q)################################################################################$(Q)
957 $(MKDIR) $(ASMDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
958 rmdir $(ASMDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
959 $(MKDIR) $(ASMDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
960 rmdir $(ASMDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
962 $(OUTDIR):
963 @echo $(Q)################################################################################$(Q)
964 @echo $(Q)# Creating the output directory... #$(Q)
965 @echo $(Q)################################################################################$(Q)
966 $(MKDIR) $(OUTDIR)$(PATHSEP)hack
967 rmdir $(OUTDIR)$(PATHSEP)hack
969 $(OBJDIR):
970 @echo $(Q)################################################################################$(Q)
971 @echo $(Q)# Creating the object directory... #$(Q)
972 @echo $(Q)################################################################################$(Q)
973 $(MKDIR) $(OBJDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
974 rmdir $(OBJDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
975 $(MKDIR) $(OBJDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
976 rmdir $(OBJDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
978 $(XGOBJDIR):
979 @echo $(Q)################################################################################$(Q)
980 @echo $(Q)# Creating the xgate object directory... #$(Q)
981 @echo $(Q)################################################################################$(Q)
982 $(MKDIR) $(XGOBJDIR)$(PATHSEP)hack
983 rmdir $(XGOBJDIR)$(PATHSEP)hack
985 distributiondir:
986 @echo $(Q)################################################################################$(Q)
987 @echo $(Q)# Creating the distribution directory... #$(Q)
988 @echo $(Q)################################################################################$(Q)
989 $(MKDIR) $(FIRMWAREDISTRIBUTIONDIR)$(PATHSEP)hack
990 rmdir $(FIRMWAREDISTRIBUTIONDIR)$(PATHSEP)hack
995 ################################################################################
996 # Clean Target Definitions #
997 ################################################################################
999 cleanasm:
1000 @echo $(Q)################################################################################$(Q)
1001 @echo $(Q)# Removing generated assembly files.... #$(Q)
1002 @echo $(Q)################################################################################$(Q)
1003 $(RM) $(ASMDIR)
1005 cleandep:
1006 @echo $(Q)################################################################################$(Q)
1007 @echo $(Q)# Removing pre-processed C output directory... #$(Q)
1008 @echo $(Q)################################################################################$(Q)
1009 $(RM) $(DEPDIR)$(PATHSEP)*.d $(DEPDIR)$(PATHSEP)*.dd
1010 $(RM) $(DEPDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)*.d $(DEPDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)*.dd
1011 $(RM) $(DEPDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)*.d $(DEPDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)*.dd
1013 cleanppc:
1014 @echo $(Q)################################################################################$(Q)
1015 @echo $(Q)# Removing pre-processed C output directory... #$(Q)
1016 @echo $(Q)################################################################################$(Q)
1017 $(RM) $(PPCDIR)
1019 cleanobj:
1020 @echo $(Q)################################################################################$(Q)
1021 @echo $(Q)# Removing object directory... #$(Q)
1022 @echo $(Q)################################################################################$(Q)
1023 $(RM) $(OBJDIR)
1025 cleanout:
1026 @echo $(Q)################################################################################$(Q)
1027 @echo $(Q)# Removing link output directory... #$(Q)
1028 @echo $(Q)################################################################################$(Q)
1029 $(RM) $(OUTDIR)
1031 cleans19:
1032 @echo $(Q)################################################################################$(Q)
1033 @echo $(Q)# Removing s19 directory... #$(Q)
1034 @echo $(Q)################################################################################$(Q)
1035 $(RM) $(S19DIR)
1037 cleandebug:
1038 @echo $(Q)################################################################################$(Q)
1039 @echo $(Q)# Removing debug directory... #$(Q)
1040 @echo $(Q)################################################################################$(Q)
1041 $(RM) $(BUGDIR)
1043 cleandoxy:
1044 @echo $(Q)################################################################################$(Q)
1045 @echo $(Q)# Removing Doxygen HTML... #$(Q)
1046 @echo $(Q)################################################################################$(Q)
1047 $(RM) ../../docs/doxygen-html/
1050 ################################################################################
1051 # Declare targets that aren't real files #
1052 ################################################################################
1055 # Aggregators top level
1056 .PHONY: all slow slowgc single help dirs
1058 # Aggregators middle level
1059 .PHONY: dependencies preprocess compile assemble link gclink s19 gcs19 sizes gcsizes
1061 # Aggregators debug level
1062 .PHONY: alldebug maps rees objdmps elfdmps size
1064 # Release targets
1065 .PHONY: release relpack1 relpack2 package packagenodoxy publish publishnodoxy
1066 .PHONY: rebuildfull rebuildnodoxy relbuildfirmware deploy deploydoxy
1067 .PHONY: md5sums sha1sums s19zips sha1sumsgc s19zips s19zipsgc
1068 .PHONY: testgit tagname tagmessage tagrelease
1069 .PHONY: zipmain zipdocs zipsite zipsrc
1071 # Messages
1072 .PHONY: mapsmsg reesmsg elfdmpsmsg objdmpmsg linkmsg gclinkmsg
1073 .PHONY: s19msg gcs19msg preprocessmsg compilemsg assemblemsg
1074 .PHONY: md5sumsmsg sha1sumsmsg s19zipsmsg
1076 # Clean targets
1077 .PHONY: clean cleandep cleanasm cleanppc cleanobj cleanout cleans19 cleandebug cleandoxy
1079 # Lonely documentation target :-(
1080 .PHONY: gendoxy