1 # A simple Makefile that attempts to weave everything together
2 # for a build. Basically:
3 # * Makes a temporary build directory
4 # * Copies itself and build.mak off, hands over to the new Makefile
5 # * Downloads the source
6 # * Compiles the native, then win32 versions
7 # * Takes the libs from native and hooks them into win32
8 # * tars it all up and calls it done
12 BUILD_DIR
= /home
/michaelh
/tmp
/$(DIST
)-build
15 NATIVE_DIST
= linux-glibc2
24 cp build.mak mega.mak
$(BUILD_DIR
)
25 make
-C
$(BUILD_DIR
) -f mega.mak build
27 build
: orig native cross
dist
30 cd
$(NATIVE
)/build
; tar czf ..
/..
/$(DIST
)-$(VER
)-$(NATIVE_DIST
).
tar.gz
$(DIST
)
31 ifeq ($(CROSS_DIST
), win32
)
32 rm -f
$(DIST
)-$(VER
)-$(CROSS_DIST
).zip
33 cd
$(CROSS
)/build
; zip
-rlq9 ..
/..
/$(DIST
)-$(VER
)-$(CROSS_DIST
).zip
$(DIST
)
35 cd
$(CROSS
)/build
; tar czf ..
/..
/$(DIST
)-$(VER
)-$(CROSS_DIST
).
tar.gz
$(DIST
)
44 touch orig
/logged_in
# Assume already logged in
45 make
-C orig
-f build.mak update
49 (cd orig
; tar cf
- .
) |
(cd linux-linux
; tar xf
-)
52 mkdir
-p linux-mingw32
53 (cd orig
; tar cf
- .
) |
(cd linux-mingw32
; tar xf
-)
55 native
: $(NATIVE
) dummy
56 cp build.mak
$(NATIVE
)
57 make
-C
$(NATIVE
) -f build.mak COMPILE_MODE
=$(NATIVE
)
61 # We do a first pass, ignored build on sdccconf.h as at the moment
62 # it fails while configuring the sim.
63 cross-bin
: $(CROSS
) dummy
65 -make
-C
$(CROSS
) -f build.mak COMPILE_MODE
=$(CROSS
) sdcc
/sdccconf.h
66 make
-C
$(CROSS
) -f build.mak COMPILE_MODE
=$(CROSS
) sdcc-bin lcc tidy
68 # Binary files are compiled; now copy the built libs from the native
71 mv
$(CROSS
)/build
/$(DIST
)/bin
$(CROSS
)/build
/$(DIST
)/bin
.1
72 (cd
$(NATIVE
); tar cf
- build
/$(DIST
)) |
(cd
$(CROSS
); tar xf
- )
73 rm -rf
$(CROSS
)/build
/$(DIST
)/bin
74 mv
$(CROSS
)/build
/$(DIST
)/bin
.1 $(CROSS
)/build
/$(DIST
)/bin
76 cross
: cross-bin cross-mix