forked from sjaehn/BJumblr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
173 lines (147 loc) · 5 KB
/
makefile
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
SHELL = /bin/sh
PKG_CONFIG ?= pkg-config
GUI_LIBS += lv2 x11 cairo sndfile
LV2_LIBS += lv2 sndfile
ifneq ($(shell $(PKG_CONFIG) --exists fontconfig || echo no), no)
GUI_LIBS += fontconfig
GUIPPFLAGS += -DPKG_HAVE_FONTCONFIG
endif
CC ?= gcc
CXX ?= g++
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= $(INSTALL) -m644
STRIP ?= strip
PREFIX ?= /usr/local
LV2DIR ?= $(PREFIX)/lib/lv2
CPPFLAGS += -DPIC
CFLAGS += -std=c99 -fvisibility=hidden -fPIC
CXXFLAGS += -std=c++11 -fvisibility=hidden -fPIC
LDFLAGS += -shared -Wl,-z,relro,-z,now
STRIPFLAGS += -s --strip-program=$(STRIP)
GUIPPFLAGS += -DPUGL_HAVE_CAIRO
DSPCFLAGS += `$(PKG_CONFIG) --cflags $(LV2_LIBS)`
GUICFLAGS += `$(PKG_CONFIG) --cflags $(GUI_LIBS)`
DSPLFLAGS += `$(PKG_CONFIG) --libs $(LV2_LIBS)`
GUILFLAGS += `$(PKG_CONFIG) --libs $(GUI_LIBS)`
ifeq ($(shell test -e src/Locale_$(LANGUAGE).hpp && echo -n yes),yes)
GUIPPFLAGS += -DLOCALEFILE=\"Locale_$(LANGUAGE).hpp\"
endif
ifdef WWW_BROWSER_CMD
GUIPPFLAGS += -DWWW_BROWSER_CMD=\"$(WWW_BROWSER_CMD)\"
endif
BUNDLE = BJumblr.lv2
DSP = BJumblr
DSP_SRC = ./src/BJumblr.cpp
GUI = BJumblr_GUI
GUI_SRC = ./src/BJumblrGUI.cpp
OBJ_EXT = .so
DSP_OBJ = $(DSP)$(OBJ_EXT)
GUI_OBJ = $(GUI)$(OBJ_EXT)
B_OBJECTS = $(addprefix $(BUNDLE)/, $(DSP_OBJ) $(GUI_OBJ))
ROOTFILES = \
manifest.ttl \
BJumblr.ttl \
LICENSE
INCFILES = inc/*.png
B_FILES = $(addprefix $(BUNDLE)/, $(ROOTFILES) $(INCFILES))
DSP_INCL = \
src/BUtilities/stof.cpp
GUI_CXX_INCL = \
src/SampleChooser.cpp \
src/BWidgets/ImageIcon.cpp \
src/BWidgets/Icon.cpp \
src/BWidgets/FileChooser.cpp \
src/BWidgets/PopupListBox.cpp \
src/BWidgets/ListBox.cpp \
src/BWidgets/ChoiceBox.cpp \
src/BWidgets/ItemBox.cpp \
src/BWidgets/Text.cpp \
src/BWidgets/UpButton.cpp \
src/BWidgets/DownButton.cpp \
src/BWidgets/LeftButton.cpp \
src/BWidgets/PlusButton.cpp \
src/BWidgets/MinusButton.cpp \
src/BWidgets/TextToggleButton.cpp \
src/BWidgets/ToggleButton.cpp \
src/BWidgets/TextButton.cpp \
src/BWidgets/Button.cpp \
src/BWidgets/DrawingSurface.cpp \
src/BWidgets/DialValue.cpp \
src/BWidgets/Dial.cpp \
src/BWidgets/Knob.cpp \
src/BWidgets/RangeWidget.cpp \
src/BWidgets/ValueWidget.cpp \
src/BWidgets/Label.cpp \
src/BWidgets/Window.cpp \
src/BWidgets/Widget.cpp \
src/BWidgets/BStyles.cpp \
src/BWidgets/BColors.cpp \
src/BWidgets/BItems.cpp \
src/BUtilities/to_string.cpp \
src/BUtilities/stof.cpp \
src/BUtilities/vsystem.cpp
GUI_C_INCL = \
src/screen.c \
src/BWidgets/cairoplus.c \
src/BWidgets/pugl/implementation.c \
src/BWidgets/pugl/x11_stub.c \
src/BWidgets/pugl/x11_cairo.c \
src/BWidgets/pugl/x11.c
$(BUNDLE): check clean $(DSP_OBJ) $(GUI_OBJ)
@cp $(ROOTFILES) $(BUNDLE)
@mkdir -p $(BUNDLE)/inc
@cp $(INCFILES) $(BUNDLE)/inc
all: $(BUNDLE)
$(DSP_OBJ): $(DSP_SRC)
@echo -n Build $(BUNDLE) DSP...
@mkdir -p $(BUNDLE)
@$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(DSPCFLAGS) -Wl,--start-group $(DSPLFLAGS) $< $(DSP_INCL) -Wl,--end-group -o $(BUNDLE)/$@
@echo \ done.
$(GUI_OBJ): $(GUI_SRC)
@echo -n Build $(BUNDLE) GUI...
@mkdir -p $(BUNDLE)
@mkdir -p $(BUNDLE)/tmp
@cd $(BUNDLE)/tmp; $(CC) $(CPPFLAGS) $(GUIPPFLAGS) $(CFLAGS) $(GUICFLAGS) $(addprefix ../../, $(GUI_C_INCL)) -c
@cd $(BUNDLE)/tmp; $(CXX) $(CPPFLAGS) $(GUIPPFLAGS) $(CXXFLAGS) $(GUICFLAGS) $(addprefix ../../, $< $(GUI_CXX_INCL)) -c
@$(CXX) $(CPPFLAGS) $(GUIPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(GUICFLAGS) -Wl,--start-group $(GUILFLAGS) $(BUNDLE)/tmp/*.o -Wl,--end-group -o $(BUNDLE)/$@
@rm -rf $(BUNDLE)/tmp
@echo \ done.
install:
@echo -n Install $(BUNDLE) to $(DESTDIR)$(LV2DIR)...
@$(INSTALL) -d $(DESTDIR)$(LV2DIR)/$(BUNDLE)
@$(INSTALL_PROGRAM) -m755 $(B_OBJECTS) $(DESTDIR)$(LV2DIR)/$(BUNDLE)
@$(INSTALL_DATA) $(B_FILES) $(DESTDIR)$(LV2DIR)/$(BUNDLE)
@cp -R $(BUNDLE) $(DESTDIR)$(LV2DIR)
@echo \ done.
install-strip:
@echo -n "Install (stripped)" $(BUNDLE) to $(DESTDIR)$(LV2DIR)...
@$(INSTALL) -d $(DESTDIR)$(LV2DIR)/$(BUNDLE)
@$(INSTALL_PROGRAM) -m755 $(STRIPFLAGS) $(B_OBJECTS) $(DESTDIR)$(LV2DIR)/$(BUNDLE)
@$(INSTALL_DATA) $(B_FILES) $(DESTDIR)$(LV2DIR)/$(BUNDLE)
@cp -R $(BUNDLE) $(DESTDIR)$(LV2DIR)
@echo \ done.
uninstall:
@echo -n Uninstall $(BUNDLE)...
@rm -f $(addprefix $(DESTDIR)$(LV2DIR)/$(BUNDLE)/, $(FILES))
@rm -f $(DESTDIR)$(LV2DIR)/$(BUNDLE)/$(GUI_OBJ)
@rm -f $(DESTDIR)$(LV2DIR)/$(BUNDLE)/$(DSP_OBJ)
-@rmdir $(DESTDIR)$(LV2DIR)/$(BUNDLE)
@echo \ done.
check:
ifeq ($(shell $(PKG_CONFIG) --exists 'sndfile > 1.0.18' || echo no), no)
$(error sndfile >= 1.0.18 not found. Please install sndfile >= 1.0.18 first.)
endif
ifeq ($(shell $(PKG_CONFIG) --exists 'lv2 >= 1.14.0' || echo no), no)
$(error lv2 >= 1.14.0 not found. Please install lv2 >= 1.14.0 first.)
endif
ifeq ($(shell $(PKG_CONFIG) --exists 'x11 >= 1.6.0' || echo no), no)
$(error x11 >= 1.6.0 not found. Please install x11 >= 1.6.0 first.)
endif
ifeq ($(shell $(PKG_CONFIG) --exists 'cairo >= 1.12.0' || echo no), no)
$(error cairo >= 1.12.0 not found. Please install cairo >= 1.12.0 first.)
endif
clean:
@rm -rf $(BUNDLE)
.PHONY: all install install-strip uninstall clean
.NOTPARALLEL: