Commit 9e3bde37 authored by a1ex's avatar a1ex
Browse files

New build process; moved common source files in src (thanks Indy!)

--HG--
branch : unified
parent 6ddcdfaede2a
MAKE=make
RM=rm
MV=mv
MKDIR=mkdir
#build system for Magic Lantern.
BINARIES_PATH=binaries
LUA_PATH=
#build and install are working, LUA not tested
#todo:
# put sources in src/
# unused things in legacy/
# put Makefile.550 and .60 in their platform dir and do:
# cd platform/550D.109; make
# -> no .o generated in rootdir. and .o in right platform
#http://www.gnu.org/software/make/manual/make.html#Automatic-Variables
#http://www.gnu.org/software/make/manual/make.html#Variables_002fRecursion
TOP_DIR=$(PWD)
include Makefile.top
all: 60D 550D 600D
60D: Makefile.60
$(MAKE) clean
$(MAKE) -f Makefile.60
$(MKDIR) -p $(BINARIES_PATH)/60D.109
$(MV) autoexec.bin $(BINARIES_PATH)/60D.109
60D:
$(MAKE) -C $(PLATFORM_PATH)/60D.109
550D:
$(MAKE) -C $(PLATFORM_PATH)/550D.109
600D:
$(MAKE) -C $(PLATFORM_PATH)/600D.101
550D: Makefile.550
$(MAKE) clean
$(MAKE) -f Makefile.550
$(MKDIR) -p $(BINARIES_PATH)/550D.109
$(MV) autoexec.bin $(BINARIES_PATH)/550D.109
600D: Makefile.600
$(MAKE) clean
$(MAKE) -f Makefile.600
$(MKDIR) -p $(BINARIES_PATH)/600D.101
$(MV) autoexec.bin $(BINARIES_PATH)/600D.101
install_60D: $(PLATFORM_PATH)/60D.109/autoexec.bin
cd $(PLATFORM_PATH)/60D.109; $(MAKE) install
install_550D: $(PLATFORM_PATH)/550D.109/autoexec.bin
cd $(PLATFORM_PATH)/550D.109; $(MAKE) install
install_600D: $(PLATFORM_PATH)/600D.109/autoexec.bin
cd $(PLATFORM_PATH)/600D.109; $(MAKE) install
clean:
-$(RM) \
*.o \
*.a \
.*.d \
$(SRC_DIR)/*.o \
$(SRC_DIR)/.*.d \
magiclantern.lds \
$(LUA_PATH)/*.o \
$(LUA_PATH)/.*.d \
*.pdf \
*.pdf
cd $(PLATFORM_PATH)/550D.109/; $(MAKE) clean
cd $(PLATFORM_PATH)/60D.109/; $(MAKE) clean
cd $(PLATFORM_PATH)/600D.101/; $(MAKE) clean
$(RM) -rf $(BINARIES_PATH)
zip:
cd $(PLATFORM_PATH)/550D.109/; $(MAKE) zip
cd $(PLATFORM_PATH)/60D.109/; $(MAKE) zip
cd $(PLATFORM_PATH)/600D.101/; $(MAKE) zip
......@@ -27,7 +27,6 @@ HOST_CFLAGS=-g -O3 -W -Wall
# Release builds:
# magiclantern-0.2.0.rc1.550d.fw109.zip
#~ VERSION=0.2.0.rc1.550d.fw109
BUILDVER=$(shell whoami)
VERSION:=$(shell LC_TIME=EN date +'%Y%b%d').$(MODEL).fw$(FW_VERSION).$(BUILDVER)
......@@ -69,44 +68,44 @@ endif
#
all: autoexec.bin
docs:
cd doc && python mkdoc.py
cd doc && python mkdoc-cam.py
docq:
cd doc && python mkdoc.py
cd doc && python mkdoc-cam.py quick
installdoc:
mkdir $(CF_CARD)/doc || echo "no problem"
mkdir $(CF_CARD)/doc/cam || echo "no problem"
cp -v doc/cam/* $(CF_CARD)/doc/cam/
install: autoexec.bin
cp $^ $(CF_CARD)
mkdir $(CF_CARD)/cropmks || echo "no problem"
cp cropmks/*.bmp $(CF_CARD)/cropmks/
cp $(TOP_DIR)/cropmks/*.bmp $(CF_CARD)/cropmks/
$(UMOUNT) $(CF_CARD)
ptpinstall: autoexec.bin
gvfs-mount -s gphoto2
sleep 2
cat ptpcam.txt | ptpcam --chdk
cat $(TOP_DIR)/ptpcam.txt | ptpcam --chdk
diff autoexec.bin autoexec.test
prepare_zip:
cp $(SRC_DIR)/zip.txt .
cp $(SRC_DIR)/README .
cp $(DOC_DIR)/INSTALL.pdf .
cp $(DOC_DIR)/UserGuide.pdf .
cp $(SRC_DIR)/make_bootable.sh .
cp $(SRC_DIR)/422-jpg.py .
mkdir cropmks || echo "ok"
cp $(CROP_DIR)/*.bmp cropmks/
mkdir doc || echo "ok"
cp $(DOC_DIR)/cam/* doc/
# zip.txt must be the first item on the list!
magiclantern-$(VERSION).zip: \
zip.txt \
magiclantern.fir \
autoexec.bin \
README \
doc/INSTALL.pdf \
doc/UserGuide.pdf \
make_bootable.sh\
INSTALL.pdf \
UserGuide.pdf \
make_bootable.sh \
422-jpg.py \
cropmks/* \
doc/cam/* \
doc/* \
-rm $@
chmod -x autoexec.bin
......@@ -123,6 +122,8 @@ CFLAGS=\
-Wno-unused-function \
-Wno-format \
-D__ARM__ \
-I$(PLATFORM_INC) \
-I$(SRC_DIR)
ifeq ($(CONFIG_PYMITE),y)
CFLAGS += $(PYMITE_CFLAGS)
......@@ -143,7 +144,7 @@ AFLAGS=\
%.s: %.c
$(call build,CC -S,$(CC) $(CFLAGS) -S -o $@ $<)
%.o: %.c
%.o: $(SRC_DIR)/%.c
$(call build,CC,$(CC) $(CFLAGS) -c -o $@ $<)
%.i: %.c
$(call build,CPP,$(CC) $(CFLAGS) -E -c -o $@ $<)
......@@ -155,7 +156,7 @@ AFLAGS=\
$(call build,OBJCOPY,$(OBJCOPY) -O binary $< $@)
zip: magiclantern-$(VERSION).zip
zip: prepare_zip magiclantern-$(VERSION).zip
FLAGS=\
-Wp,-MMD,$(dir $@).$(notdir $@).d \
......@@ -172,7 +173,6 @@ FLAGS=\
-DCONFIG_DEBUGMSG=$(CONFIG_DEBUGMSG) \
dumper: dumper_entry.o dumper.o
$(call build,LD,$(LD) \
-o $@ \
......@@ -195,9 +195,9 @@ test: test.o
dumper_entry.o: flasher-stubs.S
reboot.o: reboot.c magiclantern.bin
reboot.o: $(SRC_DIR)/reboot.c magiclantern.bin
magiclantern.lds: magiclantern.lds.S
magiclantern.lds: $(SRC_DIR)/magiclantern.lds.S
$(call build,CPP,$(CPP) $(CFLAGS) $< | grep -v '^#' > $@)
......@@ -434,15 +434,14 @@ magiclantern-5d.fir: autoexec.bin
) > $@
magiclantern.fir: autoexec.bin
@if [ -f ../dumper/build_fir.py ]; then \
python ../dumper/build_fir.py -r $^ $@ ; \
@if [ -f $(BUILDER_DIR)/build_fir.py ]; then \
python $(BUILDER_DIR)/build_fir.py -r $^ $@ ; \
else \
echo "\nNotice: ../dumper/build_fir.py not found; will not build magiclantern.fir. It's okay."; \
echo "\nNotice: $(BUILDER_DIR)/build_fir.py not found; will not build magiclantern.fir. It's okay."; \
[ -f magiclantern.fir ] && echo "Leaving magiclantern.fir unchanged.";\
[ ! -f magiclantern.fir ] && echo "Please download magiclantern.fir from http://magiclantern.wikia.com/wiki/550D";\
[ ! -f magiclantern.fir ] && echo "Please download magiclantern.fir ";\
echo "";\
fi; \
readelf -l magiclantern | grep -C 2 MemSiz ;\
stat -c "autoexec.bin: %s bytes" autoexec.bin
dummy_data_head.bin:
......@@ -503,15 +502,29 @@ build = \
fi; \
$2
docs:
cd $(DOC_DIR) && python mkdoc.py
cd $(DOC_DIR) && python mkdoc-cam.py
docq:
cd $(DOC_DIR) && python mkdoc.py
cd $(DOC_DIR) && python mkdoc-cam.py quick
installdoc:
mkdir $(CF_CARD)/doc || echo "no problem"
cp -v $(DOC_DIR)/cam/* $(CF_CARD)/doc/
clean:
-$(RM) \
*.o \
*.a \
$(RM) *.o \
.*.d \
$(BIN_FILES) \
magiclantern.lds \
$(LUA_PATH)/*.o \
$(LUA_PATH)/.*.d \
*.bmp \
*.pdf \
-include .*.d
*.txt \
make_bootable.sh \
422-jpg.py \
README \
cropmks/* \
doc/* \
|| echo clean done
MAKE=make
RM=rm
MV=mv
MKDIR=mkdir
CP=cp
export BIN_FILES=magiclantern magiclantern.bin autoexec.bin autoexec
BINARIES_PATH=binaries
LUA_PATH=
PWD=$(shell pwd)
SRC_DIR=$(TOP_DIR)/src
PLATFORM_PATH=$(TOP_DIR)/platform
BUILDER_DIR=$(TOP_DIR)/../dumper
DOC_DIR=$(TOP_DIR)/doc
CROP_DIR=$(TOP_DIR)/cropmks
BIN_FILES=magiclantern magiclantern.bin autoexec.bin autoexec
......@@ -3,7 +3,7 @@ import os,sys,string
f = open("menuindex.txt").readlines()
o = open("cam/menuidx.dat", "w")
menu = open("../menuindex.c", "w")
menu = open("../src/menuindex.c", "w")
print >> menu, """
// Auto-generated; do not edit this file.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
MAKE=make
RM=rm
MV=mv
MKDIR=mkdir
BINARIES_PATH=binaries
LUA_PATH=
#todo:
# put sources in src/
# unused things in legacy/
# put Makefile.550 and .60 in their platform dir and do:
# cd platform/550D.109; make
# -> no .o generated in rootdir. and .o in right platform
all: 60D 550D 600D
60D: Makefile.60
$(MAKE) clean
$(MAKE) -f Makefile.60
$(MKDIR) -p $(BINARIES_PATH)/60D.109
$(MV) autoexec.bin $(BINARIES_PATH)/60D.109
550D: Makefile.550
$(MAKE) clean
$(MAKE) -f Makefile.550
$(MKDIR) -p $(BINARIES_PATH)/550D.109
$(MV) autoexec.bin $(BINARIES_PATH)/550D.109
600D: Makefile.600
$(MAKE) clean
$(MAKE) -f Makefile.600
$(MKDIR) -p $(BINARIES_PATH)/600D.101
$(MV) autoexec.bin $(BINARIES_PATH)/600D.101
clean:
-$(RM) \
*.o \
*.a \
.*.d \
magiclantern.lds \
$(LUA_PATH)/*.o \
$(LUA_PATH)/.*.d \
*.pdf \
$(RM) -rf $(BINARIES_PATH)
This diff is collapsed.
--- Makefile
+++ Makefile
@@ -217,9 +217,9 @@
font-small.o \
config.o \
debug.o \
+ menu.o \
stdio.o \
audio.o \
- menu.o \
gui.o \
property.o \
zebra.o \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment