-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
38 lines (29 loc) · 1.19 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
# If RACK_DIR is not defined when calling the Makefile, default to two levels above
RACK_DIR ?= ../..
PKGCONFIG= pkg-config
PACKAGES= libusb-1.0 librtlsdr
# FLAGS will be passed to both the C and C++ compiler
FLAGS += $(shell $(PKGCONFIG) --cflags $(PACKAGES))
CFLAGS +=
CXXFLAGS +=
# Add .cpp and .c files to the build
SOURCES = $(wildcard src/*.cpp src/*.c src/*/*.cpp src/*/*.c)
# Must include the VCV plugin Makefile framework
include $(RACK_DIR)/arch.mk
# Careful about linking to libraries, since you can't assume much about the user's environment and library search path.
# Static libraries are fine.
ifeq ($(ARCH), lin)
# WARNING: static compilation is broken on Linux
LDFLAGS +=$(shell $(PKGCONFIG) --libs $(PACKAGES))
endif
ifeq ($(ARCH), mac)
LDFLAGS +=$(shell $(PKGCONFIG) --variable=libdir libusb-1.0)/libusb-1.0.a
LDFLAGS +=$(shell $(PKGCONFIG) --variable=libdir librtlsdr)/librtlsdr.a
endif
ifeq ($(ARCH), win)
LDFLAGS +=$(shell $(PKGCONFIG) --variable=libdir librtlsdr)/librtlsdr_static.a
LDFLAGS +=$(shell $(PKGCONFIG) --variable=libdir libusb-1.0)/libusb-1.0.a
endif
DISTRIBUTABLES += $(wildcard LICENSE*) res
# Include the VCV Rack plugin Makefile framework
include $(RACK_DIR)/plugin.mk