aboutsummaryrefslogtreecommitdiff
path: root/psql/Makefile
blob: c1b6958faac969001f1731cebfc83b57c42c82cf (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
NAME=psql
CSYM=psql

PDDIR=/usr/local/lib/pd
INCLUDE = -I/usr/include/postgresql

all: pd_linux
current: pd_linux

LDFLAGS = -lc -lm -lpq

# Postgres ----------------------

SRCDIR= /usr/include
TARGDIR= ./

#include Makefile.global #needed for postgresql stuff

# Linux ----------------------------------------------

pd_linux: $(NAME).pd_linux

.SUFFIXES: .pd_linux

LINUXCFLAGS =  -g -DPD -O0 -fPIC -funroll-loops -fomit-frame-pointer \
    -Wall -W -Wshadow -Wstrict-prototypes -Werror \
    -Wno-unused -Wno-parentheses -Wno-switch

.c.pd_linux:
	$(CC) $(LINUXCFLAGS) $(INCLUDE) -o $*.o -c $*.c 
	$(CC) --export-dynamic  -shared -o $*.pd_linux $*.o $(LDFLAGS) 
	strip --strip-unneeded $*.pd_linux
	rm $*.o 

# Darwin ----------------------------------------------

pd_darwin: $(NAME).pd_darwin

.SUFFIXES: .pd_darwin

DARWINCFLAGS = -DPD -O3 -Wall -W -Wshadow -Wstrict-prototypes \
    -Wno-unused -Wno-parentheses -Wno-switch -L/usr/local/lib/

.c.pd_darwin:       
	$(CC) $(DARWINCFLAGS) $(INCLUDE) -o $*.o -c $*.c
	$(CC) -bundle -undefined dynamic_lookup -o $(NAME).pd_darwin $*.o $(LDFLAGS) 
	rm -f *.o

# Install ----------------------------------------------

install:
	cp $(NAME).pd_* $(PDDIR)/extra/

# Clean ----------------------------------------------

clean:
	rm -f *.pd_* *.o