Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / support / scripts / mega.mak
blob9f8d0190195178c9b47b38380cd763fe9051bc4d
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
10 DIST = gbdk
12 BUILD_DIR = /home/michaelh/tmp/$(DIST)-build
13 NATIVE = linux-linux
14 CROSS = linux-mingw32
15 NATIVE_DIST = linux-glibc2
16 CROSS_DIST = win32
18 VER = 2.21-pre1
20 all: spawn
22 spawn:
23 mkdir -p $(BUILD_DIR)
24 cp build.mak mega.mak $(BUILD_DIR)
25 make -C $(BUILD_DIR) -f mega.mak build
27 build: orig native cross dist
29 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)
34 else
35 cd $(CROSS)/build; tar czf ../../$(DIST)-$(VER)-$(CROSS_DIST).tar.gz $(DIST)
36 endif
38 clean:
39 rm -rf $(BUILD_DIR)
41 orig:
42 mkdir -p orig
43 cp build.mak orig
44 touch orig/logged_in # Assume already logged in
45 make -C orig -f build.mak update
47 linux-linux: orig
48 mkdir -p linux-linux
49 (cd orig; tar cf - .) | (cd linux-linux; tar xf -)
51 linux-mingw32: orig
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)
59 dummy:
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
64 cp build.mak $(CROSS)
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
69 # version across
70 cross-mix:
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