|
| 1 | +# Base makefile rules |
| 2 | + |
| 3 | +# Define default target (place this first so it is always selected if no target on command line) |
| 4 | +.PHONY: default |
| 5 | +default: all |
| 6 | + |
| 7 | +MEMISOSIZE="(&_end-&_start)" |
| 8 | +# override this on the command line or in buildconf to use PRIMARY.BIN from a different tree |
| 9 | +# should be an absolute path |
| 10 | +PRIMARY_ROOT=$(topdir)platform |
| 11 | +include $(topdir)buildconf.inc |
| 12 | +# optional local version of buildconf.inc, not in SVN so it can be used in autobuilds |
| 13 | +# and to avoid getting accidentally included in svn diffs |
| 14 | +# you may also set your default camera here |
| 15 | +-include $(topdir)localbuildconf.inc |
| 16 | +include $(topdir)version.inc |
| 17 | +-include $(topdir)revision.inc |
| 18 | + |
| 19 | +# Sub-directory for object and dump files |
| 20 | +# used by modules build |
| 21 | +O=.o/ |
| 22 | + |
| 23 | +ifndef OPT_DE_VERSION |
| 24 | + VER=CHDK |
| 25 | + ifndef OPT_DEFAULT_LANG |
| 26 | + OPT_DEFAULT_LANG=english |
| 27 | + endif |
| 28 | +else |
| 29 | + VER=CHDK_DE |
| 30 | + ifndef OPT_DEFAULT_LANG |
| 31 | + OPT_DEFAULT_LANG=german |
| 32 | + endif |
| 33 | +endif |
| 34 | + |
| 35 | +# Define some shorthand file & directory locations |
| 36 | +bin=$(topdir)bin |
| 37 | +chdk=$(topdir)CHDK |
| 38 | +core=$(topdir)core |
| 39 | +doc=$(topdir)doc |
| 40 | +include=$(topdir)include |
| 41 | +loader=$(topdir)loader/$(PLATFORM) |
| 42 | +lib=$(topdir)lib |
| 43 | +larmutil=$(lib)/armutil |
| 44 | +lcore=$(lib)/core |
| 45 | +lfont=$(lib)/font |
| 46 | +llang=$(lib)/lang |
| 47 | +llibc=$(lib)/libc |
| 48 | +llua=$(lib)/lua |
| 49 | +lmath=$(lib)/math |
| 50 | +lubasic=$(lib)/ubasic |
| 51 | +modules=$(topdir)modules |
| 52 | +platform=$(topdir)platform |
| 53 | +tools=$(topdir)tools |
| 54 | +cam=$(platform)/$(PLATFORM) |
| 55 | +camfw=$(cam)/sub/$(PLATFORMSUB) |
| 56 | +TARGET_PRIMARY=$(PRIMARY_ROOT)/$(PLATFORM)/sub/$(PLATFORMSUB)/PRIMARY.BIN |
| 57 | +PAKWIF=$(tools)/pakwif$(EXE) |
| 58 | +PAKFI2=$(tools)/packfi2/fi2enc$(EXE) |
| 59 | +ENCODE_DISKBOOT=$(tools)/dancingbits$(EXE) |
| 60 | + |
| 61 | +SILENT=SILENT |
| 62 | + |
| 63 | +########################################################################## |
| 64 | + |
| 65 | +include $(topdir)makefile_env.inc |
| 66 | + |
| 67 | +########################################################################## |
| 68 | + |
| 69 | +.PHONY: all |
| 70 | +all: all-recursive |
| 71 | + |
| 72 | +.PHONY: clean |
| 73 | +clean: clean-recursive |
| 74 | + |
| 75 | +.PHONY: distclean |
| 76 | +distclean: distclean-recursive |
| 77 | + |
| 78 | +.dep: |
| 79 | + mkdir .dep |
| 80 | + |
| 81 | +clean-recursive: |
| 82 | + @for i in $(SUBDIRS); do \ |
| 83 | + echo \>\> Cleaning in $(FOLDER)$$i; \ |
| 84 | + $(MAKE) -C $$i FOLDER="$(FOLDER)$$i/" clean || exit 1; \ |
| 85 | + done |
| 86 | + |
| 87 | +distclean-recursive: |
| 88 | + @for i in $(SUBDIRS); do \ |
| 89 | + echo \>\> Distcleaning in $(FOLDER)$$i; \ |
| 90 | + $(MAKE) -C $$i FOLDER="$(FOLDER)$$i/" distclean || exit 1; \ |
| 91 | + done |
| 92 | + |
| 93 | +all-recursive: |
| 94 | + @for i in $(SUBDIRS); do \ |
| 95 | + echo \>\> Entering to $(FOLDER)$$i; \ |
| 96 | + $(MAKE) -C $$i FOLDER="$(FOLDER)$$i/" || exit 1; \ |
| 97 | + echo \<\< Leaving $(FOLDER)$$i; \ |
| 98 | + done |
| 99 | + |
| 100 | +depend-recursive: |
| 101 | + @for i in $(SUBDIRS); do \ |
| 102 | + echo \>\> Entering to $(FOLDER)$$i; \ |
| 103 | + $(MAKE) -C $$i FOLDER="$(FOLDER)$$i/" depend || exit 1; \ |
| 104 | + echo \<\< Leaving $(FOLDER)$$i; \ |
| 105 | + done |
| 106 | + |
| 107 | +ifdef SILENT |
| 108 | +.SILENT: |
| 109 | +endif |
| 110 | + |
| 111 | + |
| 112 | +# Define empty recipes for source files (including the makefiles) |
| 113 | +# to prevent make from trying implicit rules to create them. Speeds up build process |
| 114 | +Makefile: ; |
| 115 | +makefile: ; |
| 116 | +$(topdir)makefile_base.inc: ; |
| 117 | +$(topdir)buildconf.inc: ; |
| 118 | +$(topdir)localbuildconf.inc: ; |
| 119 | +$(topdir)version.inc: ; |
| 120 | +$(topdir)revision.inc: ; |
| 121 | +*.c: ; |
| 122 | +*.txt: ; |
| 123 | +*.sh: ; |
| 124 | +reversebytes.S: ; |
| 125 | +callfunc.S: ; |
| 126 | +setjmp.S: ; |
| 127 | +stubs_min.S: ; |
| 128 | +stubs_entry_2.S: ; |
0 commit comments