Makefile 2.84 KB
Newer Older
Monty Montgomery's avatar
 
Monty Montgomery committed
1 2 3 4
# Fuck Automake
# Fuck the horse it rode in on
# and Fuck its little dog Libtool too

5

6
# Use the below line to build for PowerPC
7
# The PPC build *must* use -maltivec, even if the target is a non-altivec machine
8

9
ADD_DEF= -DUGLY_IEEE754_FLOAT32_HACK=1 -maltivec -mcpu=7400
10

11 12
# use the below for x86 and most other platforms where 'float' is 32 bit IEEE754

13
#ADD_DEF= -DUGLY_IEEE754_FLOAT32_HACK=1 
14 15 16 17 18 19

# use the below for anything without IEE754 floats (eg, VAX)

# ADD_DEF=


20
CC=gcc 
Monty Montgomery's avatar
 
Monty Montgomery committed
21
LD=gcc
Monty Montgomery's avatar
 
Monty Montgomery committed
22 23
INSTALL=install
PREFIX=/usr/local
24
BINDIR=$(PREFIX)/bin
25
ETCDIR=/etc/postfish
26
MANDIR=$(PREFIX)/man
Monty Montgomery's avatar
 
Monty Montgomery committed
27

Monty Montgomery's avatar
 
Monty Montgomery committed
28
SRC = main.c mainpanel.c multibar.c readout.c input.c output.c clippanel.c \
Monty Montgomery's avatar
 
Monty Montgomery committed
29
	declip.c reconstruct.c multicompand.c windowbutton.c subpanel.c \
Monty Montgomery's avatar
 
Monty Montgomery committed
30
	feedback.c freq.c eq.c eqpanel.c compandpanel.c subband.c lpc.c \
31
	bessel.c suppresspanel.c suppress.c singlecomp.c singlepanel.c \
32 33
	limit.c limitpanel.c mute.c mixpanel.c mix.c reverb.c reverbpanel.c \
	outpanel.c config.c
Monty Montgomery's avatar
 
Monty Montgomery committed
34
OBJ = main.o mainpanel.o multibar.o readout.o input.o output.o clippanel.o \
Monty Montgomery's avatar
 
Monty Montgomery committed
35
	declip.o reconstruct.o multicompand.o windowbutton.o subpanel.o \
Monty Montgomery's avatar
 
Monty Montgomery committed
36
	feedback.o freq.o eq.o eqpanel.o compandpanel.o subband.o lpc.o \
37
	bessel.o suppresspanel.o suppress.o singlecomp.o singlepanel.o \
38 39
	limit.o limitpanel.o mute.o mixpanel.o mix.o reverb.o reverbpanel.o \
	outpanel.o config.o
40
GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0` -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
Monty Montgomery's avatar
 
Monty Montgomery committed
41 42

all:	
43
	$(MAKE) target CFLAGS="-O3 -ffast-math -fomit-frame-pointer $(GCF) $(ADD_DEF)"
Monty Montgomery's avatar
 
Monty Montgomery committed
44 45

debug:
46
	$(MAKE) target CFLAGS="-g -Wall -W -Wno-unused-parameter -D__NO_MATH_INLINES $(GCF) $(ADD_DEF)"
Monty Montgomery's avatar
 
Monty Montgomery committed
47 48

profile:
49
	$(MAKE) target CFLAGS="-pg -g -O3 -ffast-math $(GCF) $(ADD_DEF)" LIBS="-lgprof-helper "
Monty Montgomery's avatar
 
Monty Montgomery committed
50 51

clean:
52 53 54 55
	rm -f $(OBJ) *.d *.d.* gmon.out postfish

distclean: clean
	rm -f postfish-wisdomrc
Monty Montgomery's avatar
 
Monty Montgomery committed
56 57

%.d: %.c
58 59 60 61 62 63 64 65 66 67 68 69 70 71
	$(CC) -M $(CFLAGS) $< > $@.$$$$; sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$

postfish-wisdomrc:
	fftwf-wisdom -v -o postfish-wisdomrc \
	rif32 rof32 rib32 rob32 \
	rif64 rof64 rib64 rob64 \
	rif128 rof128 rib128 rob128 \
	rif256 rof256 rib256 rob256 \
	rif512 rof512 rib512 rob512 \
	rif1024 rof1024 rib1024 rob1024 \
	rif2048 rof2048 rib2048 rob2048 \
	rif4096 rof4096 rib4096 rob4096 \
	rif8192 rof8192 rib8192 rob8192 \
	rif16384 rof16384 rib16384 rob16384
Monty Montgomery's avatar
 
Monty Montgomery committed
72

73
ifeq ($(MAKECMDGOALS),target)
Monty Montgomery's avatar
 
Monty Montgomery committed
74
include $(SRC:.c=.d)
Monty Montgomery's avatar
 
Monty Montgomery committed
75
endif
Monty Montgomery's avatar
 
Monty Montgomery committed
76

77
target:  $(OBJ) postfish-wisdomrc
Monty Montgomery's avatar
 
Monty Montgomery committed
78
	./touch-version
79
	$(LD) $(OBJ) $(CFLAGS) -o postfish $(LIBS) `pkg-config --libs gtk+-2.0` -lpthread -lfftw3f -lm
Monty Montgomery's avatar
 
Monty Montgomery committed
80

81
install: target
Monty Montgomery's avatar
 
Monty Montgomery committed
82 83 84 85
	$(INSTALL) -d -m 0755 $(BINDIR)
	$(INSTALL) -m 0755 postfish $(BINDIR)
	$(INSTALL) -d -m 0755 $(ETCDIR)
	$(INSTALL) -m 0644 postfish-gtkrc $(ETCDIR)
86
	$(INSTALL) -m 0644 postfish-wisdomrc $(ETCDIR)
Monty Montgomery's avatar
 
Monty Montgomery committed
87 88 89
#	$(INSTALL) -d -m 0755 $(MANDIR)
#	$(INSTALL) -d -m 0755 $(MANDIR)/man1
#	$(INSTALL) -m 0644 postfish.1 $(MANDIR)/man1