|
| 1 | + |
| 2 | +# build all tool binaries on a Linux 64 system |
| 3 | +# |
| 4 | +# Used system: Linux Mint 19 |
| 5 | +# |
| 6 | +# This assumes that all required cross-compilation environments are properly |
| 7 | +# installed. |
| 8 | + |
| 9 | +OSXCC=/opt/osxcross/bin/o64-clang |
| 10 | +OSXC++=/opt/osxcross/bin/o64-clang++ |
| 11 | +OSXPKGCONFIG=/opt/osxcross/bin/x86_64-apple-darwin15-pkg-config |
| 12 | +OSXSTRIP=/opt/osxcross/bin/x86_64-apple-darwin15-strip |
| 13 | + |
| 14 | + |
| 15 | +BINDIR=bin |
| 16 | +#BINDIR=../sduino/hardware/sduino/tools |
| 17 | + |
| 18 | +.PHONY: all linux32 linux64 osx windows \ |
| 19 | + stm8gal stm8gal-windows stm8gal-linux32 stm8gal-linux64 stm8gal-osx \ |
| 20 | + stm8flash stm8flash-windows stm8flash-linux32 stm8flash-linux64 \ |
| 21 | + stm8flash-osx |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +# all tools for all platforms |
| 26 | +all: stm8gal stm8flash |
| 27 | + |
| 28 | + |
| 29 | +# all tools for one platform: Linux 32 bit |
| 30 | +linux32: stm8gal-linux32 stm8flash-linux32 |
| 31 | + |
| 32 | +# all tools for one platform: Linux 64 bit |
| 33 | +linux64: stm8gal-linux64 stm8flash-linux64 |
| 34 | + |
| 35 | +# all tools for one platform: OSX 10.11 64 bit |
| 36 | +osx: stm8gal-osx stm8flash-osx |
| 37 | + |
| 38 | +# all tools for one platform: Windows 64 bit |
| 39 | +windows: stm8gal-windows stm8flash-windows |
| 40 | + |
| 41 | + |
| 42 | +# stm8gal for all platforms |
| 43 | +stm8gal: stm8gal-windows stm8gal-linux32 stm8gal-linux64 stm8gal-osx |
| 44 | + |
| 45 | +# stm8flash for all platforms |
| 46 | +stm8flash: stm8flash-windows stm8flash-linux32 stm8flash-linux64 stm8flash-osx |
| 47 | + |
| 48 | + |
| 49 | +# rules for compiling stm8gal |
| 50 | +stm8gal-linux32: |
| 51 | + sed '/FLAGS/ s/ = / += /' stm8gal/Makefile > stm8gal/Makefile.linux32 |
| 52 | + CFLAGS=-m32 LDFLAGS=-m32 make -C stm8gal -f Makefile.linux32 clean all |
| 53 | + install -s -D stm8gal/stm8gal $(BINDIR)/linux32/stm8gal |
| 54 | + rm -f stm8gal/Makefile.linux32 |
| 55 | + |
| 56 | +stm8gal-linux64: |
| 57 | + make -C stm8gal clean all |
| 58 | + install -s -D stm8gal/stm8gal $(BINDIR)/linux64/stm8gal |
| 59 | + |
| 60 | +stm8gal-osx: |
| 61 | + make -C stm8gal CC=$(OSXCC) clean all |
| 62 | + install -s --strip-program=$(OSXSTRIP) -D stm8gal/stm8gal $(BINDIR)/macosx/stm8gal |
| 63 | + |
| 64 | +stm8gal-windows: |
| 65 | + make -C stm8gal CC=i686-w64-mingw32-gcc OS=Win clean all |
| 66 | + install -s -D stm8gal/stm8gal $(BINDIR)/win/stm8gal.exe |
| 67 | + |
| 68 | + |
| 69 | +# rules for compiling stm8flash |
| 70 | +stm8flash-linux32: |
| 71 | + make -C stm8flash RELEASE=yes CFLAGS=-m32 clean all |
| 72 | + install -s -D stm8flash/stm8flash $(BINDIR)/linux32/stm8flash |
| 73 | + |
| 74 | +stm8flash-linux64: |
| 75 | + make -C stm8flash RELEASE=yes clean all |
| 76 | + install -s -D stm8flash/stm8flash $(BINDIR)/linux64/stm8flash |
| 77 | + |
| 78 | +stm8flash-osx: |
| 79 | + # install dependencies: osxcross-macports install libusb-devel |
| 80 | + make -C stm8flash CC=$(OSXCC) CXX=$(OSXC++) \ |
| 81 | + PKGCONFIG=$(OSXPKGCONFIG) \ |
| 82 | + RELEASE=yes clean all |
| 83 | + install -s --strip-program=$(OSXSTRIP) -D stm8flash/stm8flash $(BINDIR)/macosx/stm8flash |
| 84 | + |
| 85 | +stm8flash-windows: |
| 86 | + make -C stm8flash CC=i686-w64-mingw32-gcc \ |
| 87 | + CFLAGS="-Iwindows/include -I../lib/windows -Lwindows/MinGW32/dll -L../lib/windows" \ |
| 88 | + PLATFORM=w7 \ |
| 89 | + RELEASE=yes clean all |
| 90 | + install -s -D stm8flash/stm8flash.exe $(BINDIR)/win/stm8flash.exe |
0 commit comments