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