forked from pantherb/setBfree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mak
193 lines (173 loc) · 5.46 KB
/
common.mak
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# TODO include this only once and export variables
PREFIX ?= /usr/local
OPTIMIZATIONS ?= -msse -msse2 -mfpmath=sse -ffast-math -fomit-frame-pointer -O3 -fno-finite-math-only
ENABLE_CONVOLUTION ?= no
INSTALL_EXTRA_LV2 ?= no
FONTFILE?=/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf
VERSION?=$(shell git describe --tags HEAD 2>/dev/null | sed 's/-g.*$$//;s/^v//' || true)
OSXCOMPAT?=-mmacosx-version-min=10.5
ifeq ($(VERSION),)
VERSION=$(EXPORTED_VERSION)
endif
ifeq ($(VERSION),)
$(warning "Cannot determine version information.")
$(warning "Use the top-level makefile (or full git clone).")
$(error "-^-")
endif
LV2VERSION=$(VERSION)
bindir = $(PREFIX)/bin
sharedir = $(PREFIX)/share/setBfree
lv2dir = $(PREFIX)/lib/lv2
CFLAGS ?= $(OPTIMIZATIONS) -Wall
ifeq ($(XWIN),)
override CFLAGS += -fPIC
endif
override CFLAGS += -DVERSION="\"$(VERSION)\""
STRIP ?= strip
CXXFLAGS ?= $(OPTIMIZATIONS) -Wall
GLUICFLAGS=-I. -I.. -Wno-unused-function
STRIPFLAGS=-s
# check for LV2
LV2AVAIL=$(shell pkg-config --exists lv2 && echo yes)
LV2UIREQ=
# check for LV2 idle thread
ifeq ($(shell pkg-config --atleast-version=1.6.0 lv2 || echo no), no)
override CFLAGS+=-DOLD_SUIL
else
GLUICFLAGS+=-DHAVE_IDLE_IFACE
LV2UIREQ=lv2:requiredFeature ui:idleInterface; lv2:extensionData ui:idleInterface;
HAVE_IDLE=yes
endif
# check for lv2_atom_forge_object new in 1.8.1 deprecates lv2_atom_forge_blank
ifeq ($(shell pkg-config --atleast-version=1.8.1 lv2 && echo yes), yes)
override CFLAGS += -DHAVE_LV2_1_8
endif
IS_OSX=
IS_WIN=
PKG_GL_LIBS=
UNAME=$(shell uname)
ifeq ($(UNAME),Darwin)
IS_OSX=yes
LV2LDFLAGS=-dynamiclib
LIB_EXT=.dylib
GLUILIBS=-framework Cocoa -framework OpenGL -framework CoreFoundation
STRIPFLAGS=-u -r -arch all -s $(RW)lv2syms
UI_TYPE=CocoaUI
PUGL_SRC=../pugl/pugl_osx.m
EXTENDED_RE=-E
else
ifneq ($(XWIN),)
IS_WIN=yes
CC=$(XWIN)-gcc
CXX=$(XWIN)-g++
STRIP=$(XWIN)-strip
LV2LDFLAGS=-Wl,-Bstatic -Wl,-Bdynamic -Wl,--as-needed -lpthread
LIB_EXT=.dll
EXE_EXT=.exe
GLUILIBS=-lws2_32 -lwinmm -lopengl32 -lglu32 -lgdi32 -lcomdlg32 -lpthread
UI_TYPE=WindowsUI
PUGL_SRC=../pugl/pugl_win.cpp
override CFLAGS+= -DHAVE_MEMSTREAM
override LDFLAGS += -static-libgcc -static-libstdc++ -DPTW32_STATIC_LIB
else
override CFLAGS+= -DHAVE_MEMSTREAM
LV2LDFLAGS=-Wl,-Bstatic -Wl,-Bdynamic
LIB_EXT=.so
PKG_GL_LIBS=glu gl
GLUICFLAGS+=-pthread
GLUILIBS=-lX11
UI_TYPE=X11UI
PUGL_SRC=../pugl/pugl_x11.c
endif
EXTENDED_RE=-r
endif
GLUICFLAGS+=`pkg-config --cflags cairo pango $(PKG_GL_LIBS)`
GLUILIBS+=`pkg-config $(PKG_UI_FLAGS) --libs cairo pango pangocairo $(PKG_GL_LIBS)`
ifneq ($(XWIN),)
GLUILIBS+=-lpthread -lusp10
endif
GLUICFLAGS+=$(LIC_CFLAGS)
GLUILIBS+=$(LIC_LOADLIBES)
ifeq ($(ENABLE_CONVOLUTION), yes)
CC=$(CXX)
endif
ifneq ($(MOD),)
MODBRAND=mod:brand \"x42\";
MODLABEL=mod:label \"$(MODNAME)\";
MODGUITTL=, <modgui.ttl>
else
MODBRAND=
MODLABEL=
MODGUITTL=
endif
#LV2 / GL-GUI
ifeq ($(FONTFILE),verabd.h)
FONT_FOUND=yes
else
ifeq ($(shell test -f $(FONTFILE) || echo no ), no)
FONT_FOUND=no
else
FONT_FOUND=yes
endif
endif
ifeq ($(MOD),)
HAVE_UI=$(shell pkg-config --exists $(PKG_GL_LIBS) ftgl && echo $(FONT_FOUND))
else
HAVE_UI=no
endif
ifeq ($(LV2AVAIL)$(HAVE_UI)$(HAVE_IDLE), yesyesyes)
UICFLAGS=-I..
UIDEPS=../pugl/pugl.h ../pugl/pugl_internal.h ../b_synth/ui_model.h
UIDEPS+=$(TX)drawbar.c $(TX)wood.c $(TX)dial.c
UIDEPS+=$(TX)btn_vibl.c $(TX)btn_vibu.c $(TX)btn_overdrive.c $(TX)btn_perc_volume.c
UIDEPS+=$(TX)btn_perc.c $(TX)btn_perc_decay.c $(TX)btn_perc_harmonic.c
UIDEPS+=$(TX)bg_right_ctrl.c $(TX)bg_left_ctrl.c $(TX)bg_leslie_drum.c $(TX)bg_leslie_horn.c
UIDEPS+=$(TX)help_screen_image.c
UIDEPS+=$(TX)ui_button_image.c $(TX)ui_proc_image.c
UIDEPS+=$(TX)uim_background.c $(TX)uim_cable1.c $(TX)uim_cable2.c $(TX)uim_caps.c
UIDEPS+=$(TX)uim_tube1.c $(TX)uim_tube2.c
ifeq ($(IS_OSX), yes)
UIDEPS+=../pugl/pugl_osx.m
UILIBS=../pugl/pugl_osx.m -framework Cocoa -framework OpenGL
UILIBS+=`pkg-config --variable=libdir ftgl`/libftgl.a `pkg-config --variable=libdir ftgl`/libfreetype.a
UILIBS+=`pkg-config --libs zlib`
UILIBS+=-lm $(OSXCOMPAT)
else
ifeq ($(IS_WIN), yes)
UIDEPS+=../pugl/pugl_win.cpp
UILIBS=../pugl/pugl_win.cpp
UILIBS+=`pkg-config --variable=libdir ftgl`/libftgl.a `pkg-config --variable=libdir ftgl`/libfreetype.a
UILIBS+=`pkg-config --libs zlib`
UILIBS+=-lws2_32 -lwinmm -lopengl32 -lglu32 -lgdi32 -lcomdlg32 -lpthread
else
UIDEPS+=../pugl/pugl_x11.c
override CFLAGS+=`pkg-config --cflags glu`
UILIBS=../pugl/pugl_x11.c -lX11
ifeq ($(STATICBUILD), yes)
UILIBS+=`pkg-config --libs glu`
UILIBS+=`pkg-config --variable=libdir ftgl`/libftgl.a `pkg-config --variable=libdir ftgl`/libfreetype.a
UILIBS+=`pkg-config --libs zlib`
else
UILIBS+=`pkg-config --libs glu ftgl`
endif
UICFLAGS+=-DFONTFILE=\"$(FONTFILE)\"
endif
endif
UICFLAGS+=`pkg-config --cflags freetype2` `pkg-config --cflags ftgl` -DHAVE_FTGL -DUINQHACK=Sbf
endif
#NOTE: midi.c and cfgParser.c needs to be re-compiled w/o HAVE_ASEQ
# and HAVE_ZITACONVOLVE. Other objects are identical.
LV2OBJ= \
../src/midi.c \
../src/cfgParser.c \
../src/program.c \
../src/vibrato.c \
../src/state.c \
../src/tonegen.c \
../src/pgmParser.c \
../src/memstream.c \
../src/midnam.c \
../b_whirl/eqcomp.c \
../b_whirl/whirl.c \
../b_overdrive/overdrive.c \
../b_reverb/reverb.c \