aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: c3aaacfffd5e79fc8d77c2046afda562f2e67567 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
current: all

.SUFFIXES: .pd_linux

INCLUDE = -I. -I/usr/local/lib/pd/src -I/home/fzotter/downloads/pd-0.39-0/pd/obj

LDFLAGS = -export-dynamic -shared
LIB = -ldl -lm -lpthread

#select either the DBG and OPT compiler flags below:

CFLAGS = -DPD -DUNIX -Wno-unused \
	-Wno-parentheses -Wno-switch -O6 -funroll-loops -fomit-frame-pointer \
        -DDL_OPEN

SYSTEM = $(shell uname -m)

# the sources

SRC = pdoctave_dataframe.c \
      pdoctave.c \
      pdoctave_send.c \
      pdoctave_command.c \
      pdoctave_get.c

TARGET = ./pdoctave.pd_linux

#TARGET2 = ./pdoctave_send.pd_linux


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

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

install: all 
	sudo cp pdoctave.pd_linux /usr/local/lib/pd/externs/

clean:
	rm -f $(OBJ) read_shared_mem.oct write_shared_mem.o write_shared_mem.oct read_shared_mem.o

all: pdoctave
#all: pdoctave pdoctave_send

pdoctave: $(OBJ) read_shared_mem.oct write_shared_mem.oct

	@echo :: $(OBJ)

	ld $(LDFLAGS) -o $(TARGET) $(OBJ) $(LIB)
	strip --strip-unneeded $(TARGET)
	#rm *.o

#pdoctave_send: $(OBJ2)
#
#	@echo :: $(OBJ2)
#
#	ld $(LDFLAGS) -o $(TARGET2) $(OBJ) $(LIB)
#	strip --strip-unneeded $(TARGET2)

$(OBJ) : %.o : %.c
	#touch $*.c
	cc $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c

read_shared_mem.oct: read_shared_mem.cc
	mkoctfile read_shared_mem.cc -c -o read_shared_mem.o
	mkoctfile read_shared_mem.o pdoctave_dataframe.o -o read_shared_mem.oct

write_shared_mem.oct: write_shared_mem.cc
	mkoctfile write_shared_mem.cc -c -o write_shared_mem.o
	mkoctfile write_shared_mem.o pdoctave_dataframe.o -o write_shared_mem.oct

pdoctave_send.o: pdoctave_send.c

pdoctave_command.o: pdoctave_command.c

pdoctave_get.o: pdoctave_get.c