summaryrefslogtreecommitdiff
path: root/support/scripts/mega.mak
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-18 00:31:54 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-18 00:31:54 +0200
commit268a53de823a6750d6256ee1fb1e7707b4b45740 (patch)
tree42c1799a9a82b2f7d9790ee9fe181d72a7274751 /support/scripts/mega.mak
downloadsdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'support/scripts/mega.mak')
-rw-r--r--support/scripts/mega.mak76
1 files changed, 76 insertions, 0 deletions
diff --git a/support/scripts/mega.mak b/support/scripts/mega.mak
new file mode 100644
index 0000000..9f8d019
--- /dev/null
+++ b/support/scripts/mega.mak
@@ -0,0 +1,76 @@
+# A simple Makefile that attempts to weave everything together
+# for a build. Basically:
+# * Makes a temporary build directory
+# * Copies itself and build.mak off, hands over to the new Makefile
+# * Downloads the source
+# * Compiles the native, then win32 versions
+# * Takes the libs from native and hooks them into win32
+# * tars it all up and calls it done
+
+DIST = gbdk
+
+BUILD_DIR = /home/michaelh/tmp/$(DIST)-build
+NATIVE = linux-linux
+CROSS = linux-mingw32
+NATIVE_DIST = linux-glibc2
+CROSS_DIST = win32
+
+VER = 2.21-pre1
+
+all: spawn
+
+spawn:
+ mkdir -p $(BUILD_DIR)
+ cp build.mak mega.mak $(BUILD_DIR)
+ make -C $(BUILD_DIR) -f mega.mak build
+
+build: orig native cross dist
+
+dist:
+ cd $(NATIVE)/build; tar czf ../../$(DIST)-$(VER)-$(NATIVE_DIST).tar.gz $(DIST)
+ifeq ($(CROSS_DIST), win32)
+ rm -f $(DIST)-$(VER)-$(CROSS_DIST).zip
+ cd $(CROSS)/build; zip -rlq9 ../../$(DIST)-$(VER)-$(CROSS_DIST).zip $(DIST)
+else
+ cd $(CROSS)/build; tar czf ../../$(DIST)-$(VER)-$(CROSS_DIST).tar.gz $(DIST)
+endif
+
+clean:
+ rm -rf $(BUILD_DIR)
+
+orig:
+ mkdir -p orig
+ cp build.mak orig
+ touch orig/logged_in # Assume already logged in
+ make -C orig -f build.mak update
+
+linux-linux: orig
+ mkdir -p linux-linux
+ (cd orig; tar cf - .) | (cd linux-linux; tar xf -)
+
+linux-mingw32: orig
+ mkdir -p linux-mingw32
+ (cd orig; tar cf - .) | (cd linux-mingw32; tar xf -)
+
+native: $(NATIVE) dummy
+ cp build.mak $(NATIVE)
+ make -C $(NATIVE) -f build.mak COMPILE_MODE=$(NATIVE)
+
+dummy:
+
+# We do a first pass, ignored build on sdccconf.h as at the moment
+# it fails while configuring the sim.
+cross-bin: $(CROSS) dummy
+ cp build.mak $(CROSS)
+ -make -C $(CROSS) -f build.mak COMPILE_MODE=$(CROSS) sdcc/sdccconf.h
+ make -C $(CROSS) -f build.mak COMPILE_MODE=$(CROSS) sdcc-bin lcc tidy
+
+# Binary files are compiled; now copy the built libs from the native
+# version across
+cross-mix:
+ mv $(CROSS)/build/$(DIST)/bin $(CROSS)/build/$(DIST)/bin.1
+ (cd $(NATIVE); tar cf - build/$(DIST)) | (cd $(CROSS); tar xf - )
+ rm -rf $(CROSS)/build/$(DIST)/bin
+ mv $(CROSS)/build/$(DIST)/bin.1 $(CROSS)/build/$(DIST)/bin
+
+cross: cross-bin cross-mix