aboutsummaryrefslogtreecommitdiff
path: root/Make.include
blob: 51e73a2d0ea7050b65898de5c9795cee2a511639 (plain)
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
current: all

PDSOURCE ?= /usr/local/src/pd/src

.SUFFIXES: .pd_linux

EXT = pd_linux

PD_LDFLAGS = --export-dynamic -shared $(LD_FLAGS)
PD_LIB = -ldl -lm -lpthread $(LIB)

#select either the DBG and OPT compiler flags below:

DBG_CFLAGS=-W -Wno-parentheses -Wno-switch -Wno-unused
CFLAGS=-O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing

PD_CFLAGS = -DPD -DUNIX -DDL_OPEN -DHAVE_G_CANVAS_H -fPIC -fno-stack-protector $(DBG_CFLAGS) $(CFLAGS)


PD_INCLUDE = -I. -I$(PDSOURCE) -I../../../../pd/src

# the sources
SRC = $(sort $(filter %.c, $(wildcard *.c)))

OBJ = $(SRC:.c=.o) 

#
#  ------------------ targets ------------------------------------
#

clean:
	-rm ../../lib/$(TARGET).$(EXT) $(TARGET).$(EXT)
	-rm *.o

all: $(OBJ)
	@echo :: $(OBJ)
	ld $(PD_LDFLAGS) -o $(TARGET).$(EXT) *.o $(PD_LIB)
	strip --strip-unneeded $(TARGET).$(EXT)
	-cp $(TARGET).$(EXT) ../../lib/

$(OBJ) : %.o : %.c
	touch $*.c
	cc $(PD_CFLAGS) $(PD_INCLUDE) -c -o $*.o $*.c