-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile
166 lines (140 loc) · 4.68 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
SHELL = /bin/sh
PKG_CONFIG ?= pkg-config
GUI_LIBS += lv2 x11 cairo
LV2_LIBS += lv2
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
LANGUAGE ?= EN
ifdef UWU
GUIPPFLAGS += -DUWU
GUIBGFILE = surface2.png
LANGUAGE = UWU
SKIN = UWU
else
GUIBGFILE = surface.png
endif
ifeq ($(shell test -e src/Locale_$(LANGUAGE).hpp && echo -n yes),yes)
GUIPPFLAGS += -DLOCALEFILE=\"Locale_$(LANGUAGE).hpp\"
endif
ifeq ($(shell test -e src/Skin_$(SKIN).hpp && echo -n yes),yes)
GUIPPFLAGS += -DSKINFILE=\"Skin_$(SKIN).hpp\"
endif
ifeq ($(shell test -e surface_$(SKIN).png && echo -n yes),yes)
GUIBGFILE = surface_$(SKIN).png
else
GUIBGFILE = surface.png
endif
DSPCFLAGS += `$(PKG_CONFIG) --cflags $(LV2_LIBS)`
GUICFLAGS += `$(PKG_CONFIG) --cflags $(GUI_LIBS)`
DSPLFLAGS += `$(PKG_CONFIG) --libs $(LV2_LIBS)`
GUILFLAGS += `$(PKG_CONFIG) --libs $(GUI_LIBS)`
BUNDLE = BSlizr.lv2
DSP = BSlizr
DSP_SRC = ./src/BSlizr.cpp
GUI = BSlizr_GUI
GUI_SRC = ./src/BSlizr_GUI.cpp
OBJ_EXT = .so
DSP_OBJ = $(DSP)$(OBJ_EXT)
GUI_OBJ = $(GUI)$(OBJ_EXT)
B_OBJECTS = $(addprefix $(BUNDLE)/, $(DSP_OBJ) $(GUI_OBJ))
FILES = manifest.ttl BSlizr.ttl LICENSE
B_FILES = $(addprefix $(BUNDLE)/, $(FILES))
DSP_INCL = \
src/Message.cpp \
src/BUtilities/stof.cpp
GUI_CXX_INCL = \
src/BWidgets/DrawingSurface.cpp \
src/BWidgets/DialValue.cpp \
src/BWidgets/Dial.cpp \
src/BWidgets/VSliderValue.cpp \
src/BWidgets/VSlider.cpp \
src/BWidgets/VScale.cpp \
src/BWidgets/HSwitch.cpp \
src/BWidgets/HSliderValue.cpp \
src/BWidgets/HSlider.cpp \
src/BWidgets/HScale.cpp \
src/BWidgets/RangeWidget.cpp \
src/BWidgets/ValueWidget.cpp \
src/BWidgets/Knob.cpp \
src/BWidgets/Label.cpp \
src/BWidgets/Window.cpp \
src/BWidgets/Widget.cpp \
src/BWidgets/BStyles.cpp \
src/BWidgets/BColors.cpp \
src/BUtilities/to_string.cpp \
src/BUtilities/stof.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
ifeq ($(shell $(PKG_CONFIG) --exists 'lv2 >= 1.12.4' || echo no), no)
$(error lv2 >= 1.12.4 not found. Please install lv2 >= 1.12.4 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
$(BUNDLE): clean $(DSP_OBJ) $(GUI_OBJ)
@cp $(FILES) $(BUNDLE)
@cp $(GUIBGFILE) $(BUNDLE)/surface.png
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.
clean:
@rm -rf $(BUNDLE)
.PHONY: all install install-strip uninstall clean
.NOTPARALLEL: