Browse Source

Require RACK_DIR, VERSION, and SLUG in Makefile, refactor dep build

system
tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
3a3960a7f4
5 changed files with 52 additions and 42 deletions
  1. +1
    -1
      Makefile
  2. +8
    -3
      compile.mk
  3. +27
    -0
      dep.mk
  4. +7
    -32
      dep/Makefile
  5. +9
    -6
      plugin.mk

+ 1
- 1
Makefile View File

@@ -1,5 +1,5 @@
RACK_DIR ?= .
VERSION = master
RACK_DIR = .

FLAGS += \
-Iinclude \


+ 8
- 3
compile.mk View File

@@ -1,16 +1,21 @@
ifdef VERSION
FLAGS += -DVERSION=$(VERSION)
ifndef RACK_DIR
$(error RACK_DIR is not defined in Makefile)
endif

ifndef VERSION
$(error VERSION is not defined in Makefile)
endif

RACK_DIR ?= .
include $(RACK_DIR)/arch.mk

FLAGS += -DVERSION=$(VERSION)
# Generate dependency files alongside the object files
FLAGS += -MMD -MP
FLAGS += -g
# Optimization
FLAGS += -O3 -march=nocona -ffast-math -fno-finite-math-only
FLAGS += -Wall -Wextra -Wno-unused-parameter

ifneq ($(ARCH), mac)
CXXFLAGS += -Wsuggest-override
endif


+ 27
- 0
dep.mk View File

@@ -0,0 +1,27 @@
include $(RACK_DIR)/arch.mk

LOCAL ?= .
FLAGS += -g -O3 -march=nocona

ifeq ($(ARCH), mac)
FLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
LDFLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
endif

CFLAGS += $(FLAGS)
CXXFLAGS += $(FLAGS)
export CFLAGS
export CXXFLAGS
export LDFLAGS

# Commands
WGET := curl -OL
UNTAR := tar xf
UNZIP := unzip
MAKE := make
CONFIGURE := ./configure --prefix="$(realpath $(LOCAL))"
ifeq ($(ARCH), win)
CMAKE := cmake -G 'MSYS Makefiles'
else
CMAKE := cmake
endif

+ 7
- 32
dep/Makefile View File

@@ -1,31 +1,6 @@
LOCAL = $(shell pwd)
RACK_DIR ?= ..

# Arch-specifics
include ../arch.mk

FLAGS += -g -O3 -march=nocona

ifeq ($(ARCH),mac)
FLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
LDFLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
endif

CFLAGS += $(FLAGS)
CXXFLAGS += $(FLAGS)
export CFLAGS
export CXXFLAGS
export LDFLAGS


# Commands
WGET = curl -OL
UNTAR = tar xf
UNZIP = unzip
ifeq ($(ARCH),win)
CMAKE = cmake -G 'MSYS Makefiles'
else
CMAKE = cmake
endif
include $(RACK_DIR)/dep.mk

# Libraries
ifeq ($(ARCH),lin)
@@ -96,14 +71,14 @@ $(glfw):
$(jansson):
$(WGET) http://www.digip.org/jansson/releases/jansson-2.10.tar.gz
$(UNTAR) jansson-2.10.tar.gz
cd jansson-2.10 && ./configure --prefix="$(LOCAL)"
cd jansson-2.10 && $(CONFIGURE)
$(MAKE) -C jansson-2.10
$(MAKE) -C jansson-2.10 install

$(libspeexdsp):
$(WGET) https://vcvrack.com/downloads/dep/speexdsp-SpeexDSP-1.2rc3.tgz
$(UNTAR) speexdsp-SpeexDSP-1.2rc3.tgz
cd speexdsp-SpeexDSP-1.2rc3 && ./configure --prefix="$(LOCAL)"
cd speexdsp-SpeexDSP-1.2rc3 && $(CONFIGURE)
$(MAKE) -C speexdsp-SpeexDSP-1.2rc3
$(MAKE) -C speexdsp-SpeexDSP-1.2rc3 install

@@ -117,7 +92,7 @@ $(openssl):
$(libcurl): $(openssl)
$(WGET) https://github.com/curl/curl/releases/download/curl-7_56_0/curl-7.56.0.tar.gz
$(UNTAR) curl-7.56.0.tar.gz
cd curl-7.56.0 && ./configure --prefix="$(LOCAL)" \
cd curl-7.56.0 && $(CONFIGURE) \
--disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual \
--without-zlib --without-libpsl --without-libmetalink --without-libssh2 --without-librtmp --without-winidn --without-libidn2 --without-nghttp2 \
--without-ca-bundle --with-ca-fallback --with-ssl="$(LOCAL)"
@@ -127,14 +102,14 @@ $(libcurl): $(openssl)
$(libzip):
$(WGET) https://nih.at/libzip/libzip-1.2.0.tar.gz
$(UNTAR) libzip-1.2.0.tar.gz
cd libzip-1.2.0 && ./configure --prefix="$(LOCAL)"
cd libzip-1.2.0 && $(CONFIGURE)
$(MAKE) -C libzip-1.2.0
$(MAKE) -C libzip-1.2.0 install

$(rtmidi):
$(WGET) https://vcvrack.com/downloads/dep/rtmidi.tgz
$(UNTAR) rtmidi.tgz
cd rtmidi && ./configure --prefix="$(LOCAL)"
cd rtmidi && $(CONFIGURE)
$(MAKE) -C rtmidi
$(MAKE) -C rtmidi install



+ 9
- 6
plugin.mk View File

@@ -1,12 +1,15 @@
RACK_DIR ?= ../..

FLAGS += -fPIC \
-I$(RACK_DIR)/include -I$(RACK_DIR)/dep/include
ifndef RACK_DIR
$(error RACK_DIR is not defined in Makefile)
endif

ifdef SLUG
FLAGS += -DSLUG=$(SLUG)
ifndef SLUG
$(error SLUG is not defined in Makefile)
endif

FLAGS += -DSLUG=$(SLUG)
FLAGS += -fPIC
FLAGS += -I$(RACK_DIR)/include -I$(RACK_DIR)/dep/include


include $(RACK_DIR)/arch.mk



Loading…
Cancel
Save