aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: be7e008d2b5674c35e01668477a523d3e0912051 (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

OS_NAME = $(shell uname -s)


# ----------------------- GNU/LINUX i386 -----------------------
ifeq ($(OS_NAME),Linux)
LDFLAGS = -export_dynamic  -shared
.SUFFIXES: .pd_linux

all: input_arrays pd_linux
pd_linux: hid.pd_linux

endif

# ----------------------- DARWIN -----------------------
ifeq ($(OS_NAME),Darwin)
FRAMEWORKS = Carbon IOKit ForceFeedback
LDFLAGS = -bundle  -bundle_loader $(PDEXECUTABLE) \
	       -L/sw/lib -L./HID\ Utilities\ Source/build \
	       -lHIDUtilities \
			 $(patsubst %,-framework %,$(FRAMEWORKS))
.SUFFIXES: .pd_darwin

all: input_arrays hid_utilities pd_darwin
pd_darwin: hid.pd_darwin

endif

# ----------------------- GENERAL ---------------------------------------------

PDEXECUTABLE = ../../../pd/bin/pd

# generic optimization
OPT_FLAGS = -O3 -ffast-math
# G4 optimization on Mac OS X
#OPT_FLAGS = -O3 -mcpu=7400 -maltivec -ffast-math -fPIC
# faster G4 7450 optimization  (gives errors) on GNU/Linux
#OPT_FLAGS = -O3 -mcpu=7450 -maltivec -ffast-math -fPIC
# G4 optimization on Mac OS X
#OPT_FLAGS = -O3 -mcpu=7400 -faltivec -ffast-math -fPIC
# faster G4 7450 optimization  (gives errors) on Mac OS X
#OPT_FLAGS = -ffast -mcpu=7450 -faltivec -ffast-math -fPIC

CFLAGS = $(OPT_FLAGS) -Wall -W -Wno-shadow -Wstrict-prototypes -Wno-unused

INCLUDE =  -I./ -I../../../pd/src -I./HID\ Utilities\ Source

.c.o:
	$(CC) $(CFLAGS) $(INCLUDE) -c *.c

.o.pd_darwin:
	$(CC) $(LDFLAGS) -o $*.pd_darwin *.o

.o.pd_linux:
	ld $(LDFLAGS) -o $*.pd_linux *.o -lc -lm
	strip --strip-unneeded $*.pd_linux

input_arrays:
	test -f input_arrays.h || ./make-arrays-from-input.h.pl

hid_utilities:
	test -f ./HID\ Utilities\ Source/build/libHIDUtilities.a || \
		( cd  ./HID\ Utilities\ Source && pbxbuild )

clean: ; rm -f *.pd_* *.o *~ input_arrays.? doc/ev*-list.pd