forked from VCVRack/Rack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.mk
60 lines (44 loc) · 1011 Bytes
/
plugin.mk
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
ifndef RACK_DIR
$(error RACK_DIR is not defined)
endif
ifndef SLUG
$(error SLUG is not defined)
endif
FLAGS += -DSLUG=$(SLUG)
FLAGS += -fPIC
FLAGS += -I$(RACK_DIR)/include -I$(RACK_DIR)/dep/include
include $(RACK_DIR)/arch.mk
ifeq ($(ARCH), lin)
LDFLAGS += -shared
TARGET := plugin.so
endif
ifeq ($(ARCH), mac)
LDFLAGS += -shared -undefined dynamic_lookup
TARGET := plugin.dylib
endif
ifeq ($(ARCH), win)
LDFLAGS += -shared -L$(RACK_DIR) -lRack
TARGET := plugin.dll
endif
DEP_FLAGS += -fPIC
include $(RACK_DIR)/dep.mk
all: $(TARGET)
include $(RACK_DIR)/compile.mk
clean:
rm -rfv build $(TARGET) dist
dist: all
rm -rf dist
mkdir -p dist/$(SLUG)
# Strip and copy plugin binary
cp $(TARGET) dist/$(SLUG)/
ifeq ($(ARCH), mac)
strip -x dist/$(SLUG)/$(TARGET)
else
strip -s dist/$(SLUG)/$(TARGET)
endif
# Copy distributables
cp -R $(DISTRIBUTABLES) dist/$(SLUG)/
# Create ZIP package
cd dist && zip -5 -r $(SLUG)-$(VERSION)-$(ARCH).zip $(SLUG)
.PHONY: clean dist
.DEFAULT_GOAL := all