root/trunk/Makefile

Revision 965, 10.6 KB (checked in by rudi_de, 3 months ago)

Wieder angleichen von CHDK und CHDK-DE (Teil 9)
Aktualisierung auf Rev. 1712, 1713, teilweise 1715 internationaler Branch: Release-1.0
 http://trac.assembla.com/chdk/changeset/1712/branches/release-1_0
 http://trac.assembla.com/chdk/changeset/1713/branches/release-1_0
 http://trac.assembla.com/chdk/changeset/1715/branches/release-1_0

Betrifft alle
+ neues Kompiler-Symbol für CHDK-Version (VER_CHDK oder VER_CHDK_DE), Danke philmoz!
+ versionsabhängige Voreinstellung der OSD-Codepage und weiterer Konfigurationswerte
* nicht benötigte JogDial-Routinen der ixus220 entfernt
* kosmetische Korrekturen

Line 
1topdir=./
2srcdir=./
3
4include buildconf.inc
5tmp:=$(shell echo "BUILD_SVNREV := $(DEF_SVN_REF)" > revision.inc)
6
7include makefile.inc
8
9BUILD_SVNREV:=$(shell svnversion -cn $(topdir) | $(ESED) 's/[0-9]*:([0-9]+)[MPS]*/\1/')
10ifeq ($(BUILD_SVNREV), )
11        BUILD_SVNREV:=$(DEF_SVN_REF)
12endif
13#for CHDK-Shell up to svn revision 1.6
14ifeq ($(BUILD_SVNREV), exported)
15        BUILD_SVNREV:=$(DEF_SVN_REF)
16endif
17ifeq ($(BUILD_SVNREV), exportiert)
18        BUILD_SVNREV:=$(DEF_SVN_REF)
19endif
20#for CHDK-Shell svn revision 1.7
21ifeq ($(BUILD_SVNREV), Unversioned directory)
22        BUILD_SVNREV:=$(DEF_SVN_REF)
23endif
24tmp:=$(shell echo "BUILD_SVNREV := $(BUILD_SVNREV)" > revision.inc)
25
26SUBDIRS=tools lib platform core loader CHDK
27
28.PHONY: fir
29fir: version firsub
30
31
32firsub: all
33        mkdir -p $(topdir)bin
34        cp $(topdir)loader/$(PLATFORM)/main.bin $(topdir)bin/main.bin
35    ifndef NOZERO100K
36        ifeq ($(OSTYPE),Windows)
37                        zero | dd bs=1k count=100 >> $(topdir)bin/main.bin 2> $(DEVNULL)
38        else
39                        dd if=/dev/zero bs=1k count=100 >> $(topdir)bin/main.bin 2> $(DEVNULL)
40        endif
41    endif
42    ifdef PLATFORMOS
43        ifeq ($(PLATFORMOS),vxworks)
44                        @echo \-\> PS.FIR
45                        $(PAKWIF) $(topdir)bin/PS.FIR $(topdir)bin/main.bin $(PLATFORMID) 0x01000101
46        endif
47        ifeq ($(PLATFORMOS),dryos)
48            ifdef OPT_FI2
49                ifdef FI2KEY
50                                        @echo \-\> PS.FI2
51                                        $(PAKFI2)  $(topdir)bin/main.bin -p $(PLATFORMID) -key $(FI2KEY) -iv $(FI2IV) $(topdir)bin/PS.FI2
52                else
53                                        @echo WARNING OPT_FI2 set but FI2KEY is not! please read platform/fi2.inc.txt
54                endif
55            endif
56        endif
57    endif
58    ifdef NEED_ENCODED_DISKBOOT
59                @echo dance \-\> DISKBOOT.BIN ver $(NEED_ENCODED_DISKBOOT)
60                $(ENCODE_DISKBOOT) $(topdir)bin/main.bin  $(topdir)bin/DISKBOOT.BIN $(NEED_ENCODED_DISKBOOT)
61                rm $(topdir)bin/main.bin
62    else
63                mv $(topdir)bin/main.bin  $(topdir)bin/DISKBOOT.BIN
64    endif
65        @echo "**** Firmware creation completed successfully"
66
67
68.PHONY: upload
69upload: fir
70        @echo Uploading...
71        cp $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB).FIR $(topdir)bin/PS.FIR
72        /home/vitalyb/Projects/ch/libptp2-1.1.0/src/ptpcam -u -m 0xbf01 --filename $(topdir)bin/PS.FIR
73
74
75infoline:
76        @echo "**** GCC $(GCC_VERSION) : BUILDING CHDK-$(VER), #$(BUILD_NUMBER)$(STATE) FOR $(PLATFORM)-$(PLATFORMSUB)-$(BUILD_SVNREV)"
77
78.PHONY: version
79version: FORCE
80        echo "**** Build: $(BUILD_NUMBER)"
81
82
83.PHONY: FORCE
84FORCE:
85
86
87firzip: version firzipsub
88
89
90firzipsub: infoline clean firsub
91        @echo \-\> $(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip
92        rm -f $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip
93        LANG=C echo -e "CHDK-$(VER) for $(PLATFORM) fw:$(PLATFORMSUB) build:$(BUILD_NUMBER) date:`date -R`" | \
94                zip -9jz $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/DISKBOOT.BIN > $(DEVNULL)
95    ifdef PLATFORMOS
96        ifeq ($(PLATFORMOS),vxworks)
97                        zip -9j $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL)
98                        rm -f $(topdir)bin/PS.FIR
99        endif
100        ifeq ($(PLATFORMOS),dryos)
101            ifdef OPT_FI2
102                ifdef FI2KEY
103                                        zip -9j $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL)
104                                        rm -f $(topdir)bin/PS.FI2
105                endif
106            endif
107        endif
108    endif
109    # if COPY_TO is defined then copy this camera/firmware version to the copied firmware version
110    # Define COPY_TO in $(topdir)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)/makefile.inc of the source
111    # firmware version that needs to be copied to another firmware version
112        # For the case where one CHDK version applies to two or more other Canon firmware version place all the
113        # 'copy to' firmware versions together seperated by ':' - e.g. "a2000,100c,BETA,100a:100b,"
114    ifdef COPY_TO
115                @echo "**** Copying duplicate Firmwares"
116                $(foreach COPY_PLATFORMSUB, $(subst :, ,$(COPY_TO)), \
117                        cp $(topdir)bin/$(VER)-$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/$(VER)-$(PLATFORM)-$(COPY_PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip ; \
118                )
119    endif
120        rm -f $(topdir)bin/DISKBOOT.BIN
121
122
123firzipsubcomplete: infoline clean firsub
124        @echo \-\> $(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip
125        rm -f $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip
126        @echo \-\> $(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip
127        rm -f $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip
128        LANG=C echo -e "CHDK-$(VER) for $(PLATFORM) fw:$(PLATFORMSUB) build:$(BUILD_NUMBER)$(STATE) date:`date -R`" | \
129        zip -9jz $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)bin/DISKBOOT.BIN > $(DEVNULL)
130        LANG=C echo -e "CHDK-$(VER) for $(PLATFORM) fw:$(PLATFORMSUB) build:$(BUILD_NUMBER)$(STATE) date:`date -R`" | \
131        zip -9jz $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/DISKBOOT.BIN > $(DEVNULL)
132        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SYMBOLS/*  > $(DEVNULL)
133        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/BOOKS/*  > $(DEVNULL)
134        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/CURVES/*  > $(DEVNULL)
135        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/CURVES/ISOBoost/*  > $(DEVNULL)
136        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/DATA/*  > $(DEVNULL)
137        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/FONTS/*  > $(DEVNULL)
138        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/GAMES/*   > $(DEVNULL)
139        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/GRIDS/* > $(DEVNULL)
140        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/LANG/*   > $(DEVNULL)
141        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/LUALIB/*   > $(DEVNULL)
142        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/LUALIB/GEN/*   > $(DEVNULL)
143        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/*  > $(DEVNULL)
144        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/EXAM/*     > $(DEVNULL)
145        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/TEST/*     > $(DEVNULL)
146        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/MD/*   > $(DEVNULL)
147        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/CURV/*     > $(DEVNULL)
148        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/SCRIPTS/USER/* > $(DEVNULL)
149        zip -9 $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)CHDK/syscurves.CVF      > $(DEVNULL)
150        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)doc/changelog.txt  > $(DEVNULL)
151        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)doc/changelog.txt  > $(DEVNULL)
152        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)tools/vers.req  > $(DEVNULL)
153        cat $(topdir)doc/1_intro.txt  $(topdir)platform/$(PLATFORM)/notes.txt $(topdir)doc/2_installation.txt $(topdir)doc/3_faq.txt $(topdir)doc/4_urls.txt $(topdir)doc/5_gpl.txt $(topdir)doc/6_ubasic_copyright.txt > $(topdir)doc/readme.txt
154        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)doc/readme.txt  > $(DEVNULL)
155        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)doc/readme.txt  > $(DEVNULL)
156
157    ifdef PLATFORMOS
158        ifeq ($(PLATFORMOS),vxworks)
159                        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL)
160                        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FIR > $(DEVNULL)
161                        rm -f $(topdir)bin/PS.FIR
162        endif
163        ifeq ($(PLATFORMOS),dryos)
164            ifdef OPT_FI2
165                ifdef FI2KEY
166                                        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL)
167                                        zip -9j $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/PS.FI2 > $(DEVNULL)
168                                        rm -f $(topdir)bin/PS.FI2
169                endif
170            endif
171        endif
172    endif
173    # if COPY_TO is defined then copy this camera/firmware version to the copied firmware version
174    # Define COPY_TO in $(topdir)/platform/$(PLATFORM)/sub/$(PLATFORMSUB)/makefile.inc of the source
175    # firmware version that needs to be copied to another firmware version
176        # For the case where one CHDK version applies to two or more other Canon firmware version place all the
177        # 'copy to' firmware versions together seperated by ':' - e.g. "a2000,100c,BETA,100a:100b,"
178    ifdef COPY_TO
179                @echo "**** Copying duplicate Firmwares"
180                $(foreach COPY_PLATFORMSUB, $(subst :, ,$(COPY_TO)), \
181                        cp $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip $(topdir)bin/$(PLATFORM)-$(COPY_PLATFORMSUB)-$(BUILD_NUMBER)-full$(STATE).zip ; \
182                        cp $(topdir)bin/$(PLATFORM)-$(PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip $(topdir)bin/$(PLATFORM)-$(COPY_PLATFORMSUB)-$(BUILD_NUMBER)$(STATE).zip ; \
183                )
184    endif
185        rm -f $(topdir)bin/DISKBOOT.BIN
186
187# define targets to batch build all cameras & firmware versions
188# list of cameras/firmware versions is in 'camera_list.csv'
189# each row in 'camera_list.csv' has 5 entries:
190# - camera (mandatory)         :- name of camera to build
191# - firmware (mandatory)       :- firmware version to build
192# - beta status (optional)     :- set to BETA for cameras still in beta status
193# - copy to (optional)         :- if this firmware version can also be used for another version on the same
194#                                 camera define the alternate firmware here. see COPY_TO comments above.
195# - skip auto build (optional) :- any value in this column will exclude the camera/firmware from the auto build
196
197batch-zip: version
198        sh tools/auto_build.sh $(MAKE) firzipsub camera_list.csv
199        @echo "**** Summary of memisosizes"
200        cat $(topdir)bin/caminfo.txt
201        rm -f $(topdir)bin/caminfo.txt   > $(DEVNULL)
202
203batch-zip-complete: version
204        sh tools/auto_build.sh $(MAKE) firzipsubcomplete camera_list.csv
205        @echo "**** Summary of memisosizes"
206        cat $(topdir)bin/caminfo.txt
207        rm -f $(topdir)bin/caminfo.txt   > $(DEVNULL)
208
209batch-clean:
210        sh tools/auto_build.sh $(MAKE) clean camera_list.csv
Note: See TracBrowser for help on using the browser.