blob: 7b48c1a92e760452678cb977cce2cfd552eb483a (
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
|
# Adapt the PDPATH if your pd is not installed in the standard place
# path for compiling against an installed version of Pd
#PDPATH="$(PROGRAMFILES)/pd"
# path for compiling from CVS with the standard developer layout
PDPATH=../../../pd
EXTERNALS = $(shell ls ../src)
all: externals
externals: $(EXTERNALS:.c=.dll)
.SUFFIXES: .dll
# these are little macros for remapping things on Windows
WINDOWS_COMPAT_DEFINES = \
-D'drand48()=((double)rand()/RAND_MAX)' \
-D'srand48(n)=srand((n))' \
# -D'bzero(p,n)=memset(p,0,n)' \
# -D'PROT_READ=1' \
# -D'MAP_PRIVATE=2' \
# -D'O_NONBLOCK=1' \
# -D'O_NDELAY=O_NONBLOCK'
DEFINES = -DPD -DNT $(WINDOWS_COMPAT_DEFINES)
# Generic x86 (tune for 686, since that's most common these days)
OPTIM_FLAGS = -O2 -march=i686 -mfpmath=sse -msse
# Pentium MMX
#OPTIM_FLAGS = -O3 -march=pentium-mmx -mmmx
# Pentium Pro
#OPTIM_FLAGS = -O3 -march=pentiumpro -mmmx
# Pentium II/Celeron
#OPTIM_FLAGS = -O3 -mfpmath=sse -mmmx -msse -march=pentium2
# Pentium III/Celeron2
#OPTIM_FLAGS = -O3 -mfpmath=sse -mmmx -msse -march=pentium3
# Pentium 4
#OPTIM_FLAGS = -O3 -mfpmath=sse -mmmx -msse -msse2 -march=pentium4
# AMD Athlon XP K7
#OPTIM_FLAGS = -O3 -march=athlon-xp -m3dnow -msse -mfpmath=sse
CFLAGS = -Wall -W -Wshadow -Wstrict-prototypes -Wno-unused -Wno-parentheses \
-Wno-switch $(OPTIM_FLAGS)
INCLUDE = -I. -I.. -I$(PDPATH)/src
DLLWRAP_FLAGS = --as=$(AS) --export-all --driver-name $(CC) -s
%.dll: ../src/%.c
$(CC) -mms-bitfields $(CFLAGS) $(DEFINES) $(INCLUDE) \
-o "$*.o" -c "../src/$*.c"
gcc -shared -o "$*.dll" "$*.o" $(PDPATH)/bin/pd.dll \
`test -f $*.libs && cat $*.libs` \
`test -f ../src/$*.libs && cat ../src/$*.libs`
clean:
-rm *.a *.def *.dll *.o *.obj
install-doc:
@test -d $(PDPATH)/doc/5.reference || mkdir -p $(PDPATH)/doc/5.reference
cd ../doc && make all
cp -r ../doc/* $(PDPATH)/doc/5.reference
install: install-doc
@test -d $(PDPATH)/extra || mkdir -p $(PDPATH)/extra
install *.dll $(PDPATH)/extra
|