-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (41 loc) · 1.66 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
BUILDDIR = build
TINYOSC = tinyosc
TINYPIPE = tinypipe
CFLAGS = -Wall -Iinclude -I$(TINYOSC) -I$(TINYPIPE) -lm -lsoundpipe -lsndfile
CC=cc
CXX=clang++
BALISET_SRC = $(wildcard src/*.c)
BALISET_TARGETS = $(BALISET_SRC:src/%.c=$(BUILDDIR)/%.o)
TINYOSC_TARGET = $(BUILDDIR)/tinyosc.o
TINYPIPE_TARGET = $(BUILDDIR)/tinypipe.o
NODE_SRCDIR = nodes
NODE_SRC = $(wildcard $(NODE_SRCDIR)/*.c)
ifeq ($(BALISET_ENV),bela)
NODE_SRC += $(wildcard $(NODE_SRCDIR)/bela/*.c)
endif
NODE_TARGETS = $(NODE_SRC:nodes/%.c=$(BUILDDIR)/%.o)
ifeq ($(BALISET_ENV),bela)
CFLAGS += -DBELA -I/root/Bela/include -L/root/Bela/lib -L/root/Bela/libraries -lbela -lbelaextra -O3 -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ftree-vectorize -ffast-math -DNDEBUG
else
CFLAGS += -O3 -g -ljack
endif
ifeq ($(BALISET_ENV),bela)
$(BUILDDIR)/baliset: $(wildcard platforms/bela/*.cpp) $(BALISET_TARGETS) $(NODE_TARGETS) $(TINYOSC_TARGET) $(TINYPIPE_TARGET)
#I'm not sure if compiling the C files with a c compiiler and then the main program with a C++ compiler is a good idea
#but I guess I'll find out
$(CXX) -o $@ $^ $(CFLAGS)
else
$(BUILDDIR)/baliset: $(wildcard platforms/jack/*.c) $(BALISET_TARGETS) $(NODE_TARGETS) $(TINYOSC_TARGET) $(TINYPIPE_TARGET)
$(CC) -o $@ $^ $(CFLAGS)
endif
$(BALISET_TARGETS): $(BUILDDIR)/%.o : src/%.c include/%.h
$(CC) -c $< -o $@ $(CFLAGS)
$(NODE_TARGETS): $(BUILDDIR)/%.o : $(NODE_SRCDIR)/%.c include/baliset_graph.h
$(CC) -c $< -o $@ $(CFLAGS)
$(TINYOSC_TARGET): $(TINYOSC)/tinyosc.c
$(CC) -c $< -o $@ -Werror -O0
$(TINYPIPE_TARGET): $(TINYPIPE)/tinypipe.c
$(CC) -c $< -o $@ -Werror -O0
.PHONY: clean
clean:
rm -f $(BUILDDIR)/*.o $(BUILDDIR)/baliset $(BUILDDIR)/bela/*