|
| 1 | +# |
| 2 | +# Makefile for komposter v2.0 |
| 3 | +# |
| 4 | +# auto-detects the platform and sets specific build options accordingly |
| 5 | +# |
| 6 | + |
| 7 | +#VERSION=2.2b-r32 |
| 8 | +VERSION=$(shell date "+%Y-%m-%d") |
| 9 | + |
| 10 | +# Set the location of your macOS SDK |
| 11 | +OSVER=$(shell sw_vers -productVersion|cut -d. -f1-2) |
| 12 | +SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(OSVER).sdk |
| 13 | + |
| 14 | +CC=gcc |
| 15 | +INSTALL_PATH_BIN=/Applications |
| 16 | +INSTALL_PATH_LIB=/Applications |
| 17 | +FREETYPE=ftinclude |
| 18 | +MCCOPTS=-Wall -I $(SDK)/usr/include/ -I $(SDK)/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I $(SDK)/Developer/Headers/ -isysroot $(SDK) -mmacosx-version-min=10.9 -Wno-deprecated-declarations -DK_VERSION="\"$(VERSION)\"" |
| 19 | +LDOPTS=-m32 -Lresources -framework OpenGL -framework GLUT -lfreetype -framework OpenAL -framework CoreFoundation -lz -mmacosx-version-min=10.9 |
| 20 | +LDPOST= |
| 21 | +DIST=dmg |
| 22 | +CCOPTS=-FGLUT -m32 -std=gnu99 -I/opt/local/include -I$(FREETYPE) |
| 23 | + |
| 24 | + |
| 25 | +## |
| 26 | +## Common to all platforms |
| 27 | +## |
| 28 | +OPTIMOPT= |
| 29 | +# -mtune=core2 -O3 |
| 30 | +DEBUGOPT=-g |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +OBJS=main.o widgets.o bezier.o synthesizer.o font.o dialog.o console.o about.o pattern.o filedialog.o patch.o sequencer.o audio.o modules.o buffermm.o fileops.o dotfile.o shader.o |
| 35 | + |
| 36 | +.DEFAULT: komposter |
| 37 | + |
| 38 | +.PHONY: clean converter player dist-dmg dist-tar.gz |
| 39 | + |
| 40 | +.c.o: |
| 41 | + $(CC) -c $(CCOPTS) $(MCCOPTS) $(DEBUGOPT) $(OPTIMOPT) $< |
| 42 | + |
| 43 | +all: komposter |
| 44 | + |
| 45 | +converter: |
| 46 | + make -C converter all |
| 47 | + |
| 48 | +player: |
| 49 | + make -C player all |
| 50 | + |
| 51 | +komposter: $(OBJS) |
| 52 | + $(CC) $(LDOPTS) -o komposter $(OBJS) $(LDPOST) |
| 53 | +# ln -s . Contents |
| 54 | + |
| 55 | +Komposter.app: komposter |
| 56 | +# strip komposter |
| 57 | + rm -rf Komposter.app |
| 58 | + mkdir Komposter.app |
| 59 | + mkdir Komposter.app/Contents |
| 60 | + mkdir Komposter.app/Contents/MacOS |
| 61 | + mkdir Komposter.app/Contents/Resources |
| 62 | + mkdir Komposter.app/Contents/Resources/shaders |
| 63 | + mkdir Komposter.app/Contents/Frameworks |
| 64 | + cp komposter Komposter.app/Contents/MacOS/Komposter |
| 65 | + install_name_tool -change /usr/local/lib/libfreetype.6.dylib @executable_path/./libfreetype.6.dylib Komposter.app/Contents/MacOS/Komposter |
| 66 | + install_name_tool -change /System/Library/Frameworks/GLUT.framework/Versions/A/GLUT @executable_path/../Frameworks/GLUT.framework/GLUT Komposter.app/Contents/MacOS/Komposter |
| 67 | + cp resources/libfreetype.6.dylib Komposter.app/Contents/MacOS/ |
| 68 | + cp -R resources/GLUT.framework Komposter.app/Contents/Frameworks/ |
| 69 | + ln -s Komposter.app/Contents/Macos/libfreetype.6.dylib Komposter.app/Contents/Macos/libfreetype.dylib |
| 70 | + cp resources/komposter.plist Komposter.app/Contents/Info.plist |
| 71 | + cp resources/komposter.PkgInfo Komposter.app/Contents/PkgInfo |
| 72 | + cp resources/komposter.AppSettings Komposter.app/Contents/Resources/AppSettings.plist |
| 73 | + cp resources/komposter.icns Komposter.app/Contents/Resources/appIcon.icns |
| 74 | + cp resources/078MKSD_MC.TTF Komposter.app/Contents/Resources/ |
| 75 | + cp resources/acknowtt.ttf Komposter.app/Contents/Resources/ |
| 76 | + cp resources/m42.TTF Komposter.app/Contents/Resources/ |
| 77 | + cp resources/shaders/*.frag Komposter.app/Contents/Resources/shaders |
| 78 | + |
| 79 | +dist: dist-$(DIST) |
| 80 | + |
| 81 | +dist-dmg: Komposter.app converter |
| 82 | + mkdir Komposter-$(VERSION) |
| 83 | + mkdir Komposter-$(VERSION)/docs |
| 84 | + mkdir Komposter-$(VERSION)/examples |
| 85 | + mkdir Komposter-$(VERSION)/converter |
| 86 | + mkdir Komposter-$(VERSION)/player |
| 87 | + cp -R Komposter.app Komposter-$(VERSION)/ |
| 88 | + cp -R examples/* Komposter-$(VERSION)/examples/ |
| 89 | + cp doc/komposter.txt Komposter-$(VERSION)/docs/ |
| 90 | + cp LICENSE Komposter-$(VERSION)/docs/COPYING.txt |
| 91 | + cp doc/fileformat.txt Komposter-$(VERSION)/docs/ |
| 92 | + cp AUTHORS Komposter-$(VERSION)/docs/AUTHORS.txt |
| 93 | + cp converter/*.[ch] converter/Makefile converter/converter Komposter-$(VERSION)/converter/ |
| 94 | + cp player/Makefile player/*.asm player/*.inc Komposter-$(VERSION)/player/ |
| 95 | + hdiutil create ./Komposter-$(VERSION).dmg -srcfolder ./Komposter-$(VERSION)/ -ov |
| 96 | + rm -rf Komposter-$(VERSION) |
| 97 | + |
| 98 | +clean: |
| 99 | + rm -f *~ *.o *.raw komposter Komposter-*.dmg komposter-*.tar.gz |
| 100 | + rm -f shaders/*~ player/*~ |
| 101 | + rm -f Contents |
| 102 | + rm -rf Komposter.app dist |
| 103 | + rm -rf Komposter-$(VERSION) |
| 104 | + make -C converter clean |
| 105 | + make -C player clean |
0 commit comments