Add in return of the number of cycles added when bumping a bench test.
[freeems-vanilla.git] / src / main / Makefile
blob6320c1d56cb32fc69653fd03f4080022578f760c
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 --dirty=-DEV)
59 OUTPREFIX := FreeEMS
60 BUILD_DATE := "$(shell date)"
61 OS := $(shell uname)
63 # Windows differences
64 ifdef ComSpec
65 # Windows uses backslash
66 PATHSEP = \\
67 # Windows mkdir does not accept -p
68 MKDIR = mkdir
69 # Windows echo repeats " symbols (Q stands for quote...)
70 Q =
71 SHASUM = sha1sum
72 else
73 PATHSEP = /
74 MKDIR = mkdir -p
75 Q = "
76 SHASUM = shasum
77 endif
79 # Mac differences
80 ifeq ($(OS), Darwin)
81 MD5SUM = md5 -r
82 else
83 # If using this on windows, we're in cygwin, same as Linux
84 MD5SUM = md5sum
85 endif
87 ifdef CLIFLAGS
88 CLIBUILD = -D CLIFLAGS=1
89 ifdef XGATE
90 CLIFLAGSARG = -D $(CLIFLAGS)=1 -D XGATE=1
91 LABEL := $(OUTPREFIX)-$(FIRMWARE_VERSION)-$(CLIFLAGS)-XGATE
92 else
93 CLIFLAGSARG = -D $(CLIFLAGS)=1
94 LABEL := $(OUTPREFIX)-$(FIRMWARE_VERSION)-$(CLIFLAGS)
95 endif
96 else
97 LABEL := $(OUTPREFIX)-$(FIRMWARE_VERSION)
98 endif
100 # Directories here
101 DISTRIBUTIONDIR = ../../tmp/$(LABEL)
102 FIRMWAREDISTRIBUTIONDIR = $(DISTRIBUTIONDIR)/$(LABEL)-firmware
103 DOXYDOCDIR = ../../docs/doxygen-html
104 MAINDIR = freeems-vanilla
105 INCDIR = inc
106 DEPDIR = dependencies
107 DECDIR = decoders
108 DATADIR = initialisers
109 BUGDIR = debug
110 OUTDIR = output
111 OBJDIR = objects
112 ASMDIR = assembly
113 XGASMDIR = assemblyxgate
114 HANDASMDIR = assemblyhand
115 S19DIR = firmware
116 PPCDIR = preprocessedc
117 XGOBJDIR = $(OBJDIR)$(PATHSEP)xgate
119 # Release tag message file
120 RELTAG = $(OUTDIR)/gitTagMessage.txt
121 TAGNAME = $(OUTDIR)/gitTagName.txt
123 # Program prefixes, for the main cpu and for the xgate coprocessor
124 PREFIX = m68hc11-
125 XGPREFIX = mc9xgate-
127 # All of the tools
128 CP = cp
129 RM = rm -rf
130 ZIP = zip
131 GCC = $(PREFIX)gcc
132 COPY = $(PREFIX)objcopy
133 DUMP = $(PREFIX)objdump
134 NM = $(PREFIX)nm
135 RE = $(PREFIX)readelf
136 SIZE = $(PREFIX)size
137 XGAS = $(XGPREFIX)as
142 ################################################################################
143 # All Source Files #
144 ################################################################################
147 # Indirect dependencies that can affect everything and cause a full rebuild
148 MFILE = Makefile
149 ASMH = 9S12XDP512asm.s
150 LINKER = memory.x regions.x hc9s12xdp512elfb.x
153 # Let's keep this to a bare minimum! If you write ASM code
154 # please provide an matching alternate C implementation too.
155 HANDASMS = flashBurn.s
156 #RPMHANDASMS =
158 ALLH = $(LINKER) $(MFILE) $(INCDIR)/$(ASMH)
160 # Warning : do not include .c files from inc/ as they are
161 # included into the other C files and automatically compiled.
163 # Flash data files
164 FIXEDCLASSES = FixedConfig1.c FixedConfig2.c
165 LOOKUPCLASSES1 = IATTransferTable.c CHTTransferTable.c
166 LOOKUPCLASSES2 = MAFTransferTable.c TestTransferTable.c
167 FUELCLASSES = FuelTables.c FuelTables2.c
168 TIMECLASSES = TimingTables.c TimingTables2.c
169 TUNECLASSES = TunableConfig.c TunableConfig2.c
170 # Combined data files
171 DATARAW = $(FIXEDCLASSES) $(LOOKUPCLASSES1) $(LOOKUPCLASSES2) $(FUELCLASSES) $(TIMECLASSES) $(TUNECLASSES)
172 DATA = $(patsubst %.c,$(DATADIR)/%.c,$(DATARAW))
174 # Source code files
175 UTILCLASSES = tableLookup.c init.c utils.c globalConstants.c StaticBenchTest.c simpleGPIO.c
176 MATHCLASSES = coreVarsGenerator.c derivedVarsGenerator.c fuelAndIgnitionCalcs.c outputScheduler.c decoderInterface.c
177 COMCLASSES = flashWrite.c commsCore.c blockDetailsLookup.c
178 ISRCLASSES = interrupts.c injectionISRs.c commsISRs.c realtimeISRs.c miscISRs.c xgateVectors.c
179 # Combined source code files
180 SOURCE = freeEMS.c staticInit.c main.c $(UTILCLASSES) $(MATHCLASSES) $(COMCLASSES) $(ISRCLASSES)
182 # All but the engine position/RPM combined here
183 CLASSES = $(SOURCE) $(DATA)
185 # Engine position/RPM here
186 # Special decoders are not for use running an engine
187 RPMSPECIAL = Listener.c BenchTest.c
188 # TODO: Automate file naming for the following 4 lines
189 RPMEVENTEETH = EvenTeeth-Cam-24and1.c EvenTeeth-Cam-16and1.c EvenTeeth-Cam-6and1.c EvenTeeth-Distributor-4of6and1.c EvenTeeth-Cam-4and1.c
190 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
191 RPMHALLOROPTICAL = HallOrOptical-Distributor-4of64.c HallOrOptical-Distributor-4of69.c
192 RPMVRDISTRIBUTOR =
193 # Specific purpose per engine stuff here
194 RPMMITSISTYLE = MitsiAndMazda-CAS-4and1.c MitsiAndMazda-CAS-4and2.c
195 RPMHONDASTYLE = JSeries-12CrankWith6-2Cam.c
196 RPMNISSANSTYLE = GM-LT1-CAS-360and8.c
197 # Insert your file above and get coding!
198 RPMSPECIFICENGINES = $(RPMMITSISTYLE) $(RPMHONDASTYLE) $(RPMNISSANSTYLE)
199 RPMCLASSESRAW = $(RPMSPECIAL) $(RPMEVENTEETH) $(RPMMISSINGTEETH) $(RPMHALLOROPTICAL) $(RPMVRDISTRIBUTOR) $(RPMSPECIFICENGINES)
200 RPMCLASSES = $(patsubst %.c,$(DECDIR)/%.c,$(RPMCLASSESRAW))
202 # XGATE stuff here!
203 XGASMSRCS = xgate.s
206 # Convert extensions
207 DEPENDENCIES = $(patsubst %.c,$(DEPDIR)/%.d,$(CLASSES))
208 DDEPENDENCIES = $(patsubst %.c,$(DEPDIR)/%.dd,$(CLASSES))
209 PREPROCESSED = $(patsubst %.c,$(PPCDIR)/%.pp.c,$(CLASSES))
210 ASSEMBLIES = $(patsubst %.c,$(ASMDIR)/%.s,$(CLASSES))
211 OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(CLASSES))
212 HANDOBJECTS = $(patsubst %.s,$(OBJDIR)/%.o,$(HANDASMS))
213 DUMPS = $(patsubst %.c,$(BUGDIR)/%.dmp,$(CLASSES)) $(patsubst %.s,$(BUGDIR)/%.dmp,$(HANDASMS))
214 XGOBJECTS = $(patsubst %.s,$(XGOBJDIR)/%.o,$(XGASMSRCS))
216 # Convert RPM extensions
217 DEPENDENCIESRPM = $(patsubst %.c,$(DEPDIR)/%.d,$(RPMCLASSES))
218 DDEPENDENCIESRPM = $(patsubst %.c,$(DEPDIR)/%.dd,$(RPMCLASSES))
219 PREPROCESSEDRPM = $(patsubst %.c,$(PPCDIR)/%.pp.c,$(RPMCLASSES))
220 ASSEMBLIESRPM = $(patsubst %.c,$(ASMDIR)/%.s,$(RPMCLASSES))
221 OBJECTSRPM = $(patsubst %.c,$(OBJDIR)/%.o,$(RPMCLASSES)) #$(patsubst $(DECDIR???)%.s,$(OBJDIR)/%.o,$(RPMHANDASMS))
222 DUMPSRPM = $(patsubst %.c,$(BUGDIR)/%.dmp,$(RPMCLASSES)) #$(patsubst $(DECDIR???)%.s,$(BUGDIR)/%.dmp,$(RPMHANDASMS))
224 # Convert to output files for source
225 ALLELFSC = $(patsubst $(DECDIR)/%.c,$(OUTDIR)/$(LABEL)-%.elf,$(RPMCLASSES))
226 ALLELFSASM = #$(patsubst %.s,$(OUTDIR)/$(LABEL)-%.elf,$(RPMHANDASMS))
227 ALLDMPSC = $(patsubst $(DECDIR)/%.c,$(BUGDIR)/$(LABEL)-%.dmp,$(RPMCLASSES))
228 ALLDMPSASM = #$(patsubst %.s,$(BUGDIR)/$(LABEL)-%.dmp,$(RPMHANDASMS))
229 ALLMAPSC = $(patsubst $(DECDIR)/%.c,$(BUGDIR)/$(LABEL)-%.map,$(RPMCLASSES))
230 ALLMAPSASM = #$(patsubst %.s,$(BUGDIR)/$(LABEL)-%.map,$(RPMHANDASMS))
231 ALLREADC = $(patsubst $(DECDIR)/%.c,$(BUGDIR)/$(LABEL)-%.ree,$(RPMCLASSES))
232 ALLREADASM = #$(patsubst %.s,$(BUGDIR)/$(LABEL)-%.ree,$(RPMHANDASMS))
233 ALLS19SC = $(patsubst $(DECDIR)/%.c,$(S19DIR)/$(LABEL)-%.s19,$(RPMCLASSES))
234 ALLS19SASM = #$(patsubst %.s,$(S19DIR)/$(LABEL)-%.s19,$(RPMHANDASMS))
236 # Convert to output files for as-is variants
237 ALLELFS = $(ALLELFSC) $(ALLELFSASM)
238 ALLDMPS = $(ALLDMPSC) $(ALLDMPSASM)
239 ALLMAPS = $(ALLMAPSC) $(ALLMAPSASM)
240 ALLREAD = $(ALLREADC) $(ALLREADASM)
241 ALLS19S = $(ALLS19SC) $(ALLS19SASM)
242 ALLSIZES = $(patsubst $(S19DIR)/%,$(OUTDIR)/%.txt,$(ALLS19S))
243 ALLDUMMY = $(patsubst $(S19DIR)/%,$(OUTDIR)/%.txt.dummy,$(ALLS19S))
244 ALLMD5S = $(patsubst $(S19DIR)/%,$(FIRMWAREDISTRIBUTIONDIR)/%.md5,$(ALLS19S))
245 ALLSHA1S = $(patsubst $(S19DIR)/%,$(FIRMWAREDISTRIBUTIONDIR)/%.sha1,$(ALLS19S))
246 ALLS19ZIPS = $(patsubst $(S19DIR)/%,$(FIRMWAREDISTRIBUTIONDIR)/%.zip,$(ALLS19S))
249 # Convert to output files for GC variants
250 GCDELFSC = $(patsubst $(DECDIR)/%.c,$(OUTDIR)/$(LABEL)-%.gc.elf,$(RPMCLASSES))
251 GCDELFSASM = #$(patsubst %.s,$(OUTDIR)/$(LABEL)-%.gc.elf,$(RPMHANDASMS))
252 GCDS19SC = $(patsubst $(DECDIR)/%.c,$(S19DIR)/$(LABEL)-%.gc.s19,$(RPMCLASSES))
253 GCDS19SASM = #$(patsubst %.s,$(S19DIR)/$(LABEL)-%.gc.s19,$(RPMHANDASMS))
254 GCDELFS = $(GCDELFSC) $(GCDELFSASM)
255 GCDS19S = $(GCDS19SC) $(GCDELFSASM)
256 GCDSIZES = $(patsubst $(S19DIR)/%,$(OUTDIR)/%.txt,$(GCDS19S))
257 GCDDUMMY = $(patsubst $(S19DIR)/%,$(OUTDIR)/%.txt.dummy,$(GCDS19S))
262 ################################################################################
263 # All Command Line Options #
264 ################################################################################
267 # M68hc1x GCC Options we may want : -minmax -mlong-calls
269 # http://www.gnu.org/software/m68hc11/m68hc11_gcc.html shows code size with different options used
270 # include debug info, optimise , 16 bit ints, hcs12 platform
271 GCCOPTS1 = -Wall -Werror -Winline -O -m68hcs12 -mshort -ffunction-sections
272 GCCOPTS2 = -fomit-frame-pointer -msoft-reg-count=8 -mauto-incdec -fsigned-char
273 GCCOPTS = $(GCCOPTS1) $(GCCOPTS2) $(CLIBUILD) $(CLIFLAGSARG) -D FIRMWARE_VERSION=\"$(FIRMWARE_VERSION)\" -D FIRMWARE_BUILD_DATE=\"$(BUILD_DATE)\" -D OPERATING_SYSTEM=\"$(OS)\"
274 # -ffunction-sections option splits out the functions such that the garbage collection can get
275 # them on a per section basis. I'm not sure, but this could be harmful to paged code so may
276 # have to review this at a later date perhaps splitting paged functions from nonpaged ones.
278 # pass to linker, link for hc12
279 # The vectors address in the linker options is the VMA address and must be short form 0xF710, not a paged address.
280 LINKOPTS = -no-warn-mismatch,-defsym,vectors_addr=0xF710,-m,m68hc12elfb,-T,hc9s12xdp512elfb.x
281 LINKOPTSGC = -no-warn-mismatch,--gc-sections,--print-gc-sections,-defsym,vectors_addr=0xF710,-m,m68hc12elfb,-T,hc9s12xdp512elfb.x
282 # Use this to get a map dump when the linker fails in a confusing way : --print-map
284 # If using the below option for paged flash, the ADDRESS_TYPE
285 # field in the freeEMSloader script should be updated to match.
286 COPYOPTS = --output-target=srec \
287 --change-section-lma .fixedconf1+0xFD4000 \
288 --change-section-lma .fixedconf2+0xFD4000 \
289 --change-section-lma .text1+0xFD4000 \
290 --change-section-lma .text+0xFEC000 \
291 --change-section-lma .data+0xFEC000 \
292 --change-section-lma .vectors+0xFEC000 \
293 --change-section-lma .rodata+0xFEC000 \
294 --only-section=.fixedconf1 \
295 --only-section=.fixedconf2 \
296 --only-section=.text \
297 --only-section=.text1 \
298 --only-section=.data \
299 --only-section=.vectors \
300 --only-section=.rodata \
301 --change-section-lma .ppageE0X=0xE08800 \
302 --change-section-lma .ppageE1=0xE18000 \
303 --only-section=.ppageE0X \
304 --only-section=.ppageE1 \
305 --set-section-flags .ppageE1=alloc,load \
306 --change-section-lma .ppageF8=0xF88000 \
307 --change-section-lma .fpageF9=0xF98000 \
308 --change-section-lma .dpageF9=0xF9A000 \
309 --change-section-lma .ppageFE=0xFE8000 \
310 --only-section=.ppageF8 \
311 --only-section=.fpageF9 \
312 --only-section=.dpageF9 \
313 --only-section=.ppageFE \
314 --change-section-lma .fpageFA=0xFA8000 \
315 --change-section-lma .dpageFA=0xFAA000 \
316 --change-section-lma .fpageFB=0xFB8000 \
317 --change-section-lma .dpageFB1=0xFBA000 \
318 --change-section-lma .dpageFB2=0xFBA400 \
319 --change-section-lma .dpageFB3=0xFBA800 \
320 --change-section-lma .dpageFB4=0xFBAC00 \
321 --change-section-lma .dpageFB5=0xFBB000 \
322 --change-section-lma .dpageFB6=0xFBB400 \
323 --change-section-lma .dpageFB7=0xFBB800 \
324 --change-section-lma .dpageFB8=0xFBBC00 \
325 --change-section-lma .fpageFC=0xFC8000 \
326 --change-section-lma .dpageFC=0xFCA000 \
327 --only-section=.dpageFA \
328 --only-section=.fpageFA \
329 --only-section=.dpageFB1 \
330 --only-section=.dpageFB2 \
331 --only-section=.dpageFB3 \
332 --only-section=.dpageFB4 \
333 --only-section=.dpageFB5 \
334 --only-section=.dpageFB6 \
335 --only-section=.dpageFB7 \
336 --only-section=.dpageFB8 \
337 --only-section=.fpageFB \
338 --only-section=.dpageFC \
339 --only-section=.fpageFC
340 # --change-section-lma .ppageFD=0xFD8000 \
341 # --change-section-lma .ppageFF=0xFF8000 \
342 # --only-section=.ppageFD \ This is left here for clarity only (equivalent to text1 but paged)
343 # --only-section=.ppageFF This is left here for clarity only (equivalent to text but paged)
344 # Changes to the above options should be reflected in memory.x and memory.h also!
346 # The following flash areas should only be included if they are used.
347 # --only-section=.ppageE0S \
348 # --only-section=.ppageE2 \
349 # --only-section=.ppageE3 \
350 # --only-section=.ppageE4 \
351 # --only-section=.ppageE5 \
352 # --only-section=.ppageE6 \
353 # --only-section=.ppageE7 \
354 # --only-section=.ppageE8 \
355 # --only-section=.ppageE9 \
356 # --only-section=.ppageEA \
357 # --only-section=.ppageEB \
358 # --only-section=.ppageEC \
359 # --only-section=.ppageED \
360 # --only-section=.ppageEE \
361 # --only-section=.ppageEF \
362 # --only-section=.ppageF0 \
363 # --only-section=.ppageF1 \
364 # --only-section=.ppageF2 \
365 # --only-section=.ppageF3 \
366 # --only-section=.ppageF4 \
367 # --only-section=.ppageF5 \
368 # --only-section=.ppageF6 \
369 # --only-section=.ppageF7 \
370 # --change-section-lma .ppageE0S=0xE08000 \
371 # --change-section-lma .ppageE2=0xE28000 \
372 # --change-section-lma .ppageE3=0xE38000 \
373 # --change-section-lma .ppageE4=0xE48000 \
374 # --change-section-lma .ppageE5=0xE58000 \
375 # --change-section-lma .ppageE6=0xE68000 \
376 # --change-section-lma .ppageE7=0xE78000 \
377 # --change-section-lma .ppageE8=0xE88000 \
378 # --change-section-lma .ppageE9=0xE98000 \
379 # --change-section-lma .ppageEA=0xEA8000 \
380 # --change-section-lma .ppageEB=0xEB8000 \
381 # --change-section-lma .ppageEC=0xEC8000 \
382 # --change-section-lma .ppageED=0xED8000 \
383 # --change-section-lma .ppageEE=0xEE8000 \
384 # --change-section-lma .ppageEF=0xEF8000 \
385 # --change-section-lma .ppageF0=0xF08000 \
386 # --change-section-lma .ppageF1=0xF18000 \
387 # --change-section-lma .ppageF2=0xF28000 \
388 # --change-section-lma .ppageF3=0xF38000 \
389 # --change-section-lma .ppageF4=0xF48000 \
390 # --change-section-lma .ppageF5=0xF58000 \
391 # --change-section-lma .ppageF6=0xF68000 \
392 # --change-section-lma .ppageF7=0xF78000 \
397 help:
398 @echo $(Q)################################################################################$(Q)
399 @echo $(Q)# Dependency And Target Summary #$(Q)
400 @echo $(Q)################################################################################$(Q)
401 @echo $(Q)# #$(Q)
402 @echo $(Q)# Common targets: #$(Q)
403 @echo $(Q)# #$(Q)
404 @echo $(Q)# 1) help - This comment block #$(Q)
405 @echo $(Q)# 2) all - Executes alldebug, slow, slowgc and size #$(Q)
406 @echo $(Q)# 3) dirs - Creates all of the directories required to build #$(Q)
407 @echo $(Q)# 5) slow - Three stage compilation with assembly retained #$(Q)
408 @echo $(Q)# 6) slowgc - As above, but with garbage collection during linking #$(Q)
409 @echo $(Q)# 7) alldebug - Generates all debug output files #$(Q)
410 @echo $(Q)# 8) install - Not yet implemented #$(Q)
411 @echo $(Q)# 9) release - Performs a full release build #$(Q)
412 @echo $(Q)# 10) clean - Removes all files and directories generated by building #$(Q)
413 @echo $(Q)# #$(Q)
414 @echo $(Q)# Second level targets: #$(Q)
415 @echo $(Q)# #$(Q)
416 @echo $(Q)# Stage one: #$(Q)
417 @echo $(Q)# #$(Q)
418 @echo $(Q)# 1) preprocess - run the C preprocessor over the raw C files #$(Q)
419 @echo $(Q)# 2) compile - compile the preprocessed C into assembly #$(Q)
420 @echo $(Q)# 3) assemble - assemble the assembly files into object files #$(Q)
421 @echo $(Q)# #$(Q)
422 @echo $(Q)# Stage two #$(Q)
423 @echo $(Q)# #$(Q)
424 @echo $(Q)# 1) link - Generate ELFs objects #$(Q)
425 @echo $(Q)# 2) gclink - As above, but with garbage collection #$(Q)
426 @echo $(Q)# 3) s19 - Create s19s from elfs #$(Q)
427 @echo $(Q)# 4) gcs19 - Create s19s from gc elfs #$(Q)
428 @echo $(Q)# 5) sizes - Calculate the approximate s19 sizes #$(Q)
429 @echo $(Q)# 6) gcsizes - Calculate the approximate gc s19 sizes #$(Q)
430 @echo $(Q)# #$(Q)
431 @echo $(Q)# Stage three: #$(Q)
432 @echo $(Q)# #$(Q)
433 @echo $(Q)# 1) maps - Memory map files #$(Q)
434 @echo $(Q)# 2) rees - Readelf dumps #$(Q)
435 @echo $(Q)# 3) elfdmps - Classic objdump output for final elfs #$(Q)
436 @echo $(Q)# 4) objdmps - Classic objdump output for each object file #$(Q)
437 @echo $(Q)# #$(Q)
438 @echo $(Q)# When doing a full build the following steps are taken: #$(Q)
439 @echo $(Q)# #$(Q)
440 @echo $(Q)# 1) Pre-process all of the C files #$(Q)
441 @echo $(Q)# 2) Compile all preprocessed C files into assembly files #$(Q)
442 @echo $(Q)# 3) Assemble all assembly files into object files #$(Q)
443 @echo $(Q)# 4) Link each decoder without garbage collection #$(Q)
444 @echo $(Q)# 5) Produce a memory map for each elf #$(Q)
445 @echo $(Q)# 6) Produce a readelf dump for each elf #$(Q)
446 @echo $(Q)# 7) Dump the contents of each decoders elf #$(Q)
447 @echo $(Q)# 8) Dump the contents of all object files #$(Q)
448 @echo $(Q)# 9) Link each decoder with garbage collection and reporting turned on #$(Q)
449 @echo $(Q)# 10) Produce an s19 loadable firmware file for each elf #$(Q)
450 @echo $(Q)# 11) Measure each binary image approximately #$(Q)
451 @echo $(Q)# 12) Measure each decoder object file #$(Q)
452 @echo $(Q)# 13) Measure each other object file and summarise #$(Q)
453 @echo $(Q)# #$(Q)
454 @echo $(Q)# The release target: #$(Q)
455 @echo $(Q)# #$(Q)
456 @echo $(Q)# This target is purely for use by lead developers to produce a file set #$(Q)
457 @echo $(Q)# that is suitable for release and distribution to users and interested #$(Q)
458 @echo $(Q)# parties. The steps performed are listed below: #$(Q)
459 @echo $(Q)# #$(Q)
460 @echo $(Q)# 1) Checks that the repository is consistent #$(Q)
461 @echo $(Q)# 2) Performs a full clean #$(Q)
462 @echo $(Q)# 4) Removes the doxygen files #$(Q)
463 @echo $(Q)# 5) Builds binaries for each decoder type #$(Q)
464 @echo $(Q)# 7) Generates a new doxygen site #$(Q)
465 @echo $(Q)# 8) Performs a full clean #$(Q)
466 @echo $(Q)# 9) Commits the release files #$(Q)
467 @echo $(Q)# 10) Asks for a tag name and tag message #$(Q)
468 @echo $(Q)# 11) Tags the release at the automatic commit point #$(Q)
469 @echo $(Q)# 12) Generates md5 and sha1 checksums into the distribution directory #$(Q)
470 @echo $(Q)# 13) Zips the binaries into the distribution directory #$(Q)
471 @echo $(Q)# 14) Zips the doxygen site into the distribution directory #$(Q)
472 @echo $(Q)# 15) Zips the documentation into the distribution directory #$(Q)
473 @echo $(Q)# 16) Zips the repository into the distribution directory #$(Q)
474 @echo $(Q)# 17) Zips the source code into the distribution directory #$(Q)
475 @echo $(Q)# #$(Q)
476 @echo $(Q)# At that point the developer in charge of release has only to upload #$(Q)
477 @echo $(Q)# the files found in the distribution directory to appropriate locations #$(Q)
478 @echo $(Q)# and publicise the fact that a new release has been performed! This #$(Q)
479 @echo $(Q)# automation removes most opportunity for mistakes and makes release #$(Q)
480 @echo $(Q)# quality consistent between each successive release cycle! #$(Q)
481 @echo $(Q)# #$(Q)
482 @echo $(Q)# Unlisted targets: #$(Q)
483 @echo $(Q)# #$(Q)
484 @echo $(Q)# Additionally any of the output files can be used as a target directly. #$(Q)
485 @echo $(Q)# This is perfect for building only what is required for a specific s19. #$(Q)
486 @echo $(Q)# It is also perfect for working with a single file as you don't have to #$(Q)
487 @echo $(Q)# wait for other unrelated things to build first nor do you have to wait #$(Q)
488 @echo $(Q)# for other files to continue building after yours is successful. Before #$(Q)
489 @echo $(Q)# using individual output files for targets, please run 'make dirs'. #$(Q)
490 @echo $(Q)# #$(Q)
491 @echo $(Q)# Common goals: #$(Q)
492 @echo $(Q)# #$(Q)
493 @echo $(Q)# You most likely just want to run \"make s19\" or \"make clean\", do that! #$(Q)
494 @echo $(Q)# #$(Q)
495 @echo $(Q)# To build with a specific compiled in configuration do this instead: #$(Q)
496 @echo $(Q)# #$(Q)
497 @echo $(Q)# CLIFLAGS=\"YOURBUILDNAME\" make clean s19 #$(Q)
498 @echo $(Q)# #$(Q)
499 @echo $(Q)################################################################################$(Q)
504 ################################################################################
505 # Single Decoder Builds #
506 ################################################################################
509 Listener: $(S19DIR)/$(LABEL)-Listener.s19
510 BenchTest: $(S19DIR)/$(LABEL)-BenchTest.s19
511 EvenTeeth-Cam-24and1: $(S19DIR)/$(LABEL)-EvenTeeth-Cam-24and1.s19
512 EvenTeeth-Cam-16and1: $(S19DIR)/$(LABEL)-EvenTeeth-Cam-16and1.s19
513 EvenTeeth-Cam-6and1: $(S19DIR)/$(LABEL)-EvenTeeth-Cam-6and1.s19
514 EvenTeeth-Cam-4and1: $(S19DIR)/$(LABEL)-EvenTeeth-Cam-4and1.s19
515 MissingTeeth-Crank-8minus1: $(S19DIR)/$(LABEL)-MissingTeeth-Crank-8minus1.s19
516 MissingTeeth-Crank-12minus1: $(S19DIR)/$(LABEL)-MissingTeeth-Crank-12minus1.s19
517 MissingTeeth-Cam-12minus1: $(S19DIR)/$(LABEL)-MissingTeeth-Cam-12minus1.s19
518 HallOrOptical-Distributor-4of69: $(S19DIR)/$(LABEL)-HallOrOptical-Distributor-4of69.s19
519 MitsiAndMazda-CAS-4and1: $(S19DIR)/$(LABEL)-MitsiAndMazda-CAS-4and1.s19
520 MitsiAndMazda-CAS-4and2: $(S19DIR)/$(LABEL)-MitsiAndMazda-CAS-4and2.s19
521 GM-LT1-CAS-360and8: $(S19DIR)/$(LABEL)-GM-LT1-CAS-360and8.s19
522 JSeries-12CrankWith6-2Cam: $(S19DIR)/$(LABEL)-JSeries-12CrankWith6-2Cam.s19
523 EvenTeeth-Distributor-4of6and1: $(S19DIR)/$(LABEL)-EvenTeeth-Distributor-4of6and1.s19
524 MissingTeeth-Crank-36minus2: $(S19DIR)/$(LABEL)-MissingTeeth-Crank-36minus2.s19
529 ################################################################################
530 # Generated Dependencies #
531 ################################################################################
534 # Bring in all of the generated deps. Note, if these fail on the first pass of parsing, Make will generate them and reparse.
535 -include $(DEPENDENCIES) $(DEPENDENCIESRPM) $(DDEPENDENCIES) $(DDEPENDENCIESRPM)
540 ################################################################################
541 # All Target Dependencies #
542 ################################################################################
545 # Build everything the long way
546 all: alldebug gcsizes sizes size
547 # Multi stage compilation
548 slow: sizes size
549 # Multi stage compilation with garbage collection
550 slowgc: gcsizes size
551 # Clean all except release
552 clean: cleandep cleanasm cleanobj cleanout cleanppc cleans19 cleandebug
553 # Generate all debug
554 alldebug: maps rees elfdmps objdmps
555 # Load the s19 of your choice
556 #install: clean slow loader
557 # Perform a release
558 release: testgit relbuildfull tagrelease
559 package: relbuildfull relpack1 relpack2 zipsite
560 publish: package deploydoxy deploy
561 publishnodoxy: packagenodoxy deploy
562 packagenodoxy: relbuildfirmware relpack1 relpack2
563 relbuildfull: clean cleandoxy gendoxy s19
564 relbuildfirmware: clean s19
565 relpack1: md5sums sha1sums s19zips
566 relpack2: zipdocs zipmain zipsrc
569 # Force dates and versions to be up to date
570 $(PPCDIR)/globalConstants.pp.c: .FORCE
571 .FORCE:
574 ################################################################################
575 # Debug Target Definitions #
576 ################################################################################
579 mapsmsg:
580 @echo $(Q)################################################################################$(Q)
581 @echo $(Q)# Generating memory maps.... #$(Q)
582 @echo $(Q)################################################################################$(Q)
584 maps: link mapsmsg $(ALLMAPS)
586 $(BUGDIR)/%.map: $(OUTDIR)/%.elf $(BUGDIR)
587 $(NM) $< | sort > $@
590 reesmsg:
591 @echo $(Q)################################################################################$(Q)
592 @echo $(Q)# Reading all elf files... #$(Q)
593 @echo $(Q)################################################################################$(Q)
595 rees: link reesmsg $(ALLREAD)
597 $(BUGDIR)/%.ree: $(OUTDIR)/%.elf $(BUGDIR)
598 $(RE) -a -W $< > $@
601 elfdmpsmsg:
602 @echo $(Q)################################################################################$(Q)
603 @echo $(Q)# Dumping all elf files... #$(Q)
604 @echo $(Q)################################################################################$(Q)
606 elfdmps: link elfdmpsmsg $(ALLDMPS)
608 $(BUGDIR)/%.dmp: $(OUTDIR)/%.elf $(BUGDIR)
609 $(DUMP) -spSd $< > $@
612 objdmpmsg:
613 @echo $(Q)################################################################################$(Q)
614 @echo $(Q)# Dumping all object files.... #$(Q)
615 @echo $(Q)################################################################################$(Q)
617 objdmps: assemble objdmpmsg $(DUMPS) $(DUMPSRPM)
619 $(BUGDIR)/%.dmp: $(OBJDIR)/%.o $(BUGDIR)
620 $(DUMP) -spSd $< > $@
625 ################################################################################
626 # Link and Copy Target Definitions #
627 ################################################################################
630 linkmsg:
631 @echo $(Q)################################################################################$(Q)
632 @echo $(Q)# Linking the Objects into an ELF... #$(Q)
633 @echo $(Q)################################################################################$(Q)
635 link: assemble linkmsg $(ALLELFS)
637 # link the object files into an elf executable
638 $(OUTDIR)/$(LABEL)-%.elf: $(OBJDIR)/$(DECDIR)/%.o $(OBJECTS) $(HANDOBJECTS) $(XGOBJECTS) $(OUTDIR)
639 @echo $(Q)################################################################################$(Q)
640 @echo $(Q)# Linking $@ ...$(Q)
641 @echo $(Q)################################################################################$(Q)
642 $(GCC) $(GCCOPTS) -Wl,$(LINKOPTS) -o $@ $(OBJECTS) $(HANDOBJECTS) $(XGOBJECTS) $<
645 gclinkmsg:
646 @echo $(Q)################################################################################$(Q)
647 @echo $(Q)# Linking the Objects into an ELF... #$(Q)
648 @echo $(Q)################################################################################$(Q)
650 gclink: assemble linkmsg $(GCDELFS)
652 # link the object files into an elf executable with gc enabled
653 $(OUTDIR)/$(LABEL)-%.gc.elf: $(OBJDIR)/$(DECDIR)/%.o $(OBJECTS) $(HANDOBJECTS) $(XGOBJECTS) $(OUTDIR)
654 @echo $(Q)################################################################################$(Q)
655 @echo $(Q)# Linking $@ ...$(Q)
656 @echo $(Q)################################################################################$(Q)
657 $(GCC) $(GCCOPTS) -Wl,$(LINKOPTSGC) -o $@ $(OBJECTS) $(HANDOBJECTS) $(XGOBJECTS) $<
658 # The links with garbage collection are to ensure that there are no warnings
659 # TODO find out how to stop .tramp from being collected (or inserted)!
660 # This will be the only way once Sean's stuff is done and distributed, I can't wait to cut all this bullshit out!
663 s19msg:
664 @echo $(Q)################################################################################$(Q)
665 @echo $(Q)# Building The S19 Files.... #$(Q)
666 @echo $(Q)################################################################################$(Q)
668 s19: link s19msg $(ALLS19S)
669 # the gc dependency is temporary until i figure out if the .tramp removal is an issue or not.
671 # Generate the loadable s19 firmware files
672 $(S19DIR)/%.s19: $(OUTDIR)/%.elf $(S19DIR)
673 @echo $(Q)################################################################################$(Q)
674 @echo $(Q)# Building $(@F) ...$(Q)
675 @echo $(Q)################################################################################$(Q)
676 $(COPY) $(COPYOPTS) $< $(@F)
677 mv $(@F) $@
680 sizesmsg:
681 @echo $(Q)################################################################################$(Q)
682 @echo $(Q)# Measuring The S19 Files... #$(Q)
683 @echo $(Q)################################################################################$(Q)
685 sizes: s19 sizesmsg $(ALLSIZES) $(ALLDUMMY)
688 # Roughly measure the s19 sizes
689 $(OUTDIR)/%.txt: $(S19DIR)/% $(OUTDIR)
690 echo $(shell cat $< | wc -l) $(Q)* 16$(Q) > $@
692 # Have to do this in two stages to allow $(shell exp) use and portability to windows
693 $(OUTDIR)/%.dummy: $(OUTDIR)/% $(OUTDIR)
694 echo $(Q)Flash image size is$(Q) $(shell cat $< | bc -l) $(Q)bytes for $<$(Q)
697 gcs19msg:
698 @echo $(Q)################################################################################$(Q)
699 @echo $(Q)# Building The GC S19 Files.... #$(Q)
700 @echo $(Q)################################################################################$(Q)
702 gcs19: gclink gcs19msg $(GCDS19S)
704 # Generate the garbage collected s19 files temporarily
705 $(S19DIR)/%.s19: $(OUTDIR)/%.elf $(S19DIR)
706 @echo $(Q)################################################################################$(Q)
707 @echo $(Q)# Building $(@F) ...$(Q)
708 @echo $(Q)################################################################################$(Q)
709 $(COPY) $(COPYOPTS) $< $(@F)
710 mv $(@F) $@
712 gcsizesmsg:
713 @echo $(Q)################################################################################$(Q)
714 @echo $(Q)# Measuring The GC S19 Files... #$(Q)
715 @echo $(Q)################################################################################$(Q)
717 gcsizes: gcs19 gcsizesmsg $(GCDSIZES) $(GCDDUMMY)
719 # Roughly measure the gc s19 sizes
720 $(OUTDIR)/%.txt: $(S19DIR)/% $(OUTDIR)
721 @echo $(shell cat $< | wc -l) $(Q)* 16$(Q) > $@
723 # Have to do this in two stages to allow $(shell exp) use and portability to windows
724 $(OUTDIR)/%.dummy: $(OUTDIR)/% $(OUTDIR)
725 @echo $(Q)Flash image size is$(Q) $(shell cat $< | bc -l) $(Q)bytes for $<$(Q)
731 ################################################################################
732 # Size Measuring Target Definition #
733 ################################################################################
736 size: assemble # TODO this should be run for each s19 target with only the one rpm .o file
737 @echo $(Q)################################################################################$(Q)
738 @echo $(Q)# Measuring The Decoder Binaries... #$(Q)
739 @echo $(Q)################################################################################$(Q)
740 $(SIZE) $(OBJECTSRPM)
741 @echo $(Q)################################################################################$(Q)
742 @echo $(Q)# Measuring All Other Binaries... #$(Q)
743 @echo $(Q)################################################################################$(Q)
744 $(SIZE) -t $(OBJECTS)
745 @echo $(Q)################################################################################$(Q)
746 @echo $(Q)# Add one decoder to the total above and #$(Q)
747 @echo $(Q)# subtract the size reported for freeEMS.o #$(Q)
748 @echo $(Q)# this will give you the actual image size #$(Q)
749 @echo $(Q)################################################################################$(Q)
750 @echo $(Q)# #$(Q)
751 @echo $(Q)# Thank you for building FreeEMS firmware!!! #$(Q)
752 @echo $(Q)# #$(Q)
753 @echo $(Q)################################################################################$(Q)
758 ################################################################################
759 # Preprocess, Compile and Assemble Target Definitions #
760 ################################################################################
763 dependenciesmsg:
764 @echo $(Q)################################################################################$(Q)
765 @echo $(Q)# Generating the dependencies... #$(Q)
766 @echo $(Q)################################################################################$(Q)
768 dependencies: dependenciesmsg $(DEPENDENCIES) $(DEPENDENCIESRPM) $(DDEPENDENCIES) $(DDEPENDENCIESRPM)
770 # Generate dependency files for recompilation on change semantics
771 $(DEPENDENCIES) $(DEPENDENCIESRPM): $(DEPDIR)/%.d: %.c $(ALLH)
772 $(GCC) $(CLIBUILD) $(CLIFLAGSARG) -MM -MF $@ -MT $(PPCDIR)/$*.pp.c $<
773 # Generate dependency files for the dependency files...
774 $(DDEPENDENCIES) $(DDEPENDENCIESRPM): $(DEPDIR)/%.dd: %.c $(ALLH)
775 $(GCC) $(CLIBUILD) $(CLIFLAGSARG) -MM -MF $@ -MT $(DEPDIR)/$*.d $<
778 preprocessmsg:
779 @echo $(Q)################################################################################$(Q)
780 @echo $(Q)# Running the C Pre Processor... #$(Q)
781 @echo $(Q)################################################################################$(Q)
783 preprocess: preprocessmsg $(PREPROCESSED) $(PREPROCESSEDRPM)
785 # Generate preprocessed source files to examine
786 $(PPCDIR)/%.pp.c: %.c $(ALLH) $(PPCDIR)
787 $(GCC) $(GCCOPTS) -D BASE_FILE_NAME=\"$(*F)\" -E $< > $@
788 $(PPCDIR)/decoders/%.pp.c: decoders/%.c $(ALLH) $(PPCDIR)
789 $(GCC) $(GCCOPTS) -D BASE_FILE_NAME=\"$(*F)\" -E $< > $@
792 compilemsg:
793 @echo $(Q)################################################################################$(Q)
794 @echo $(Q)# Compiling PPC to Assembly... #$(Q)
795 @echo $(Q)################################################################################$(Q)
797 compile: preprocess compilemsg $(ASSEMBLIES) $(ASSEMBLIESRPM)
799 # Generate assembly files to examine
800 $(ASMDIR)/%.s: $(PPCDIR)/%.pp.c $(ASMDIR)
801 $(GCC) -g $(GCCOPTS) -x cpp-output -S -o $@ $<
804 assemblemsg:
805 @echo $(Q)################################################################################$(Q)
806 @echo $(Q)# Assembling Object Files... #$(Q)
807 @echo $(Q)################################################################################$(Q)
809 assemble: compile assemblemsg $(OBJECTS) $(HANDOBJECTS) $(OBJECTSRPM) $(XGOBJECTS)
811 # Generate object files to link
812 $(OBJDIR)/%.o: $(ASMDIR)/%.s $(OBJDIR)
813 $(GCC) $(GCCOPTS) -c -o $@ $<
815 $(OBJDIR)/%.o: $(HANDASMDIR)/%.s $(OBJDIR)
816 $(GCC) -g $(GCCOPTS) -c -o $@ $<
818 $(XGOBJDIR)/%.o: $(XGASMDIR)/%.s $(XGOBJDIR)
819 $(XGAS) -o $@ $<
823 ################################################################################
824 # Release Procedure Target Definitions #
825 ################################################################################
828 # Debian only :-p
829 testgit:
830 @echo "################################################################################"
831 @echo "# Checking git status... #"
832 @echo "################################################################################"
833 @echo "Are we on master?"
834 test `git symbolic-ref HEAD` = refs/heads/master
835 @echo "Is everything checked in?"
836 test `git status -s | wc -l` -eq 0
837 @echo "Fetching from origin..."
838 git fetch
839 @echo "Are we behind?"
840 test `git rev-list \`git show-ref --hash refs/heads/master\`..\`git show-ref --hash refs/remotes/origin/master\` | wc -l` -eq 0
841 @echo "Are we ahead?"
842 test `git rev-list \`git show-ref --hash refs/remotes/origin/master\`..\`git show-ref --hash refs/heads/master\` | wc -l` -eq 0
845 md5sumsmsg:
846 @echo $(Q)################################################################################$(Q)
847 @echo $(Q)# Generating MD5 Sums... #$(Q)
848 @echo $(Q)################################################################################$(Q)
850 md5sums: s19 md5sumsmsg $(ALLMD5S)
852 $(FIRMWAREDISTRIBUTIONDIR)/%.s19.md5: $(S19DIR)/%.s19 distributiondir
853 $(MD5SUM) $< > $@
856 sha1sumsmsg:
857 @echo $(Q)################################################################################$(Q)
858 @echo $(Q)# Generating SHA1 Sums... #$(Q)
859 @echo $(Q)################################################################################$(Q)
861 sha1sums: s19 sha1sumsmsg $(ALLSHA1S)
863 $(FIRMWAREDISTRIBUTIONDIR)/%.s19.sha1: $(S19DIR)/%.s19 distributiondir
864 $(SHASUM) $< > $@
869 s19zipsmsg:
870 @echo $(Q)################################################################################$(Q)
871 @echo $(Q)# Zipping S19s... #$(Q)
872 @echo $(Q)################################################################################$(Q)
874 s19zips: s19 s19zipsmsg $(ALLS19ZIPS)
876 $(FIRMWAREDISTRIBUTIONDIR)/%.s19.zip: $(S19DIR)/%.s19 distributiondir
877 zip -j $@ $<
880 tagmessage:
881 vim $(RELTAG)
883 tagname:
884 vim $(TAGNAME)
887 tagrelease: tagname tagmessage
888 git tag -F $(RELTAG) `cat $(TAGNAME)` HEAD
891 zipmain: distributiondir
892 cd ../../ ; git archive --format=zip --prefix=$(LABEL)/ HEAD > ./tmp/$(DISTRIBUTIONDIR)/$(LABEL)-full.zip;cd -
894 zipdocs: distributiondir
895 cd ../../ ; git archive --format=zip --prefix=$(LABEL)- HEAD docs/ > ./tmp/$(DISTRIBUTIONDIR)/$(LABEL)-docs.zip;cd -
897 gendoxy: clean
898 cd ../../ ; ( cat docs/Doxyfile ; echo "PROJECT_NUMBER=$(FIRMWARE_VERSION)" ) | doxygen - | grep Warning > src/doxygen.output;cd -
900 zipsite: distributiondir gendoxy
901 cd ../../docs/ ; zip -r $(DISTRIBUTIONDIR)/$(LABEL)-doxygen-html.zip doxygen-html/;cd -
903 zipsrc: distributiondir
904 cd ../../ ; git archive --format=zip --prefix=$(LABEL)- HEAD src/ > ./tmp/$(DISTRIBUTIONDIR)/$(LABEL)-src.zip;cd -
906 deploy: distributiondir
907 scp -r $(DISTRIBUTIONDIR) raptor:/home/firmware/releases/
909 deploydoxy: zipsite
910 scp -r $(DISTRIBUTIONDIR)/$(LABEL)-doxygen-html.zip raptor:/home/docs/releases/
911 ssh raptor unzip /home/docs/releases/$(LABEL)-doxygen-html.zip -d /home/docs/releases/
912 ssh raptor mv /home/docs/releases/doxygen-html/ /home/docs/releases/$(FIRMWARE_VERSION)
917 ################################################################################
918 # Create Directory Target Definitions #
919 ################################################################################
921 # Assembly, release and inc directories don't get removed.
923 dirs: $(BUGDIR) $(S19DIR) $(PPCDIR) $(OUTDIR) $(OBJDIR) $(XGOBJDIR) $(ASMDIR)
925 $(BUGDIR):
926 @echo $(Q)################################################################################$(Q)
927 @echo $(Q)# Creating the debug directory.... #$(Q)
928 @echo $(Q)################################################################################$(Q)
929 $(MKDIR) $(BUGDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
930 rmdir $(BUGDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
931 $(MKDIR) $(BUGDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
932 rmdir $(BUGDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
934 $(S19DIR):
935 @echo $(Q)################################################################################$(Q)
936 @echo $(Q)# Creating the firmware directory... #$(Q)
937 @echo $(Q)################################################################################$(Q)
938 $(MKDIR) $(S19DIR)$(PATHSEP)hack
939 rmdir $(S19DIR)$(PATHSEP)hack
941 $(PPCDIR):
942 @echo $(Q)################################################################################$(Q)
943 @echo $(Q)# Creating the preprocessedc directory.... #$(Q)
944 @echo $(Q)################################################################################$(Q)
945 $(MKDIR) $(PPCDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
946 rmdir $(PPCDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
947 $(MKDIR) $(PPCDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
948 rmdir $(PPCDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
950 $(ASMDIR):
951 @echo $(Q)################################################################################$(Q)
952 @echo $(Q)# Creating the assembly directory... #$(Q)
953 @echo $(Q)################################################################################$(Q)
954 $(MKDIR) $(ASMDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
955 rmdir $(ASMDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
956 $(MKDIR) $(ASMDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
957 rmdir $(ASMDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
959 $(OUTDIR):
960 @echo $(Q)################################################################################$(Q)
961 @echo $(Q)# Creating the output directory... #$(Q)
962 @echo $(Q)################################################################################$(Q)
963 $(MKDIR) $(OUTDIR)$(PATHSEP)hack
964 rmdir $(OUTDIR)$(PATHSEP)hack
966 $(OBJDIR):
967 @echo $(Q)################################################################################$(Q)
968 @echo $(Q)# Creating the object directory... #$(Q)
969 @echo $(Q)################################################################################$(Q)
970 $(MKDIR) $(OBJDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
971 rmdir $(OBJDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)hack
972 $(MKDIR) $(OBJDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
973 rmdir $(OBJDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)hack
975 $(XGOBJDIR):
976 @echo $(Q)################################################################################$(Q)
977 @echo $(Q)# Creating the xgate object directory... #$(Q)
978 @echo $(Q)################################################################################$(Q)
979 $(MKDIR) $(XGOBJDIR)$(PATHSEP)hack
980 rmdir $(XGOBJDIR)$(PATHSEP)hack
982 distributiondir:
983 @echo $(Q)################################################################################$(Q)
984 @echo $(Q)# Creating the distribution directory... #$(Q)
985 @echo $(Q)################################################################################$(Q)
986 $(MKDIR) $(FIRMWAREDISTRIBUTIONDIR)$(PATHSEP)hack
987 rmdir $(FIRMWAREDISTRIBUTIONDIR)$(PATHSEP)hack
992 ################################################################################
993 # Clean Target Definitions #
994 ################################################################################
996 cleanasm:
997 @echo $(Q)################################################################################$(Q)
998 @echo $(Q)# Removing generated assembly files.... #$(Q)
999 @echo $(Q)################################################################################$(Q)
1000 $(RM) $(ASMDIR)
1002 cleandep:
1003 @echo $(Q)################################################################################$(Q)
1004 @echo $(Q)# Removing pre-processed C output directory... #$(Q)
1005 @echo $(Q)################################################################################$(Q)
1006 $(RM) $(DEPDIR)$(PATHSEP)*.d $(DEPDIR)$(PATHSEP)*.dd
1007 $(RM) $(DEPDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)*.d $(DEPDIR)$(PATHSEP)$(DECDIR)$(PATHSEP)*.dd
1008 $(RM) $(DEPDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)*.d $(DEPDIR)$(PATHSEP)$(DATADIR)$(PATHSEP)*.dd
1010 cleanppc:
1011 @echo $(Q)################################################################################$(Q)
1012 @echo $(Q)# Removing pre-processed C output directory... #$(Q)
1013 @echo $(Q)################################################################################$(Q)
1014 $(RM) $(PPCDIR)
1016 cleanobj:
1017 @echo $(Q)################################################################################$(Q)
1018 @echo $(Q)# Removing object directory... #$(Q)
1019 @echo $(Q)################################################################################$(Q)
1020 $(RM) $(OBJDIR)
1022 cleanout:
1023 @echo $(Q)################################################################################$(Q)
1024 @echo $(Q)# Removing link output directory... #$(Q)
1025 @echo $(Q)################################################################################$(Q)
1026 $(RM) $(OUTDIR)
1028 cleans19:
1029 @echo $(Q)################################################################################$(Q)
1030 @echo $(Q)# Removing s19 directory... #$(Q)
1031 @echo $(Q)################################################################################$(Q)
1032 $(RM) $(S19DIR)
1034 cleandebug:
1035 @echo $(Q)################################################################################$(Q)
1036 @echo $(Q)# Removing debug directory... #$(Q)
1037 @echo $(Q)################################################################################$(Q)
1038 $(RM) $(BUGDIR)
1040 cleandoxy:
1041 @echo $(Q)################################################################################$(Q)
1042 @echo $(Q)# Removing Doxygen HTML... #$(Q)
1043 @echo $(Q)################################################################################$(Q)
1044 $(RM) ../../docs/doxygen-html/
1047 ################################################################################
1048 # Declare targets that aren't real files #
1049 ################################################################################
1052 # Aggregators top level
1053 .PHONY: all slow slowgc single help dirs
1055 # Aggregators middle level
1056 .PHONY: dependencies preprocess compile assemble link gclink s19 gcs19 sizes gcsizes
1058 # Aggregators debug level
1059 .PHONY: alldebug maps rees objdmps elfdmps size
1061 # Release targets
1062 .PHONY: release relpack1 relpack2 package packagenodoxy publish publishnodoxy
1063 .PHONY: rebuildfull rebuildnodoxy relbuildfirmware deploy deploydoxy
1064 .PHONY: md5sums sha1sums s19zips sha1sumsgc s19zips s19zipsgc
1065 .PHONY: testgit tagname tagmessage tagrelease
1066 .PHONY: zipmain zipdocs zipsite zipsrc
1068 # Messages
1069 .PHONY: mapsmsg reesmsg elfdmpsmsg objdmpmsg linkmsg gclinkmsg
1070 .PHONY: s19msg gcs19msg preprocessmsg compilemsg assemblemsg
1071 .PHONY: md5sumsmsg sha1sumsmsg s19zipsmsg
1073 # Clean targets
1074 .PHONY: clean cleandep cleanasm cleanppc cleanobj cleanout cleans19 cleandebug cleandoxy
1076 # Lonely documentation target :-(
1077 .PHONY: gendoxy