Makefile 2.65 KB
Newer Older
1 2 3 4
# Fuck Automake
# Fuck the horse it rode in on
# and Fuck its little dog Libtool too

5 6 7 8 9 10 11 12 13

ADD_DEF= -DUGLY_IEEE754_FLOAT32_HACK=1 -maltivec

# use for PPC with altivec.  IF YOU HAVE ALTIVEC, YOU MUST USE THIS
# LINE, otherwise FFTW3 will randomly crash whenever it uses Altivec
# and any math denormalizes.

#ADD_DEF= -DUGLY_IEEE754_FLOAT32_HACK=1 -maltivec

14
CC=gcc 
15
LD=gcc
16 17 18
INSTALL=install
PREFIX=/usr/local
BINDIR=$PREFIX/bin
19
ETCDIR=/etc/postfish
20
MANDIR=$PREFIX/man
21

22
SRC = main.c mainpanel.c multibar.c readout.c input.c output.c clippanel.c \
23
	declip.c reconstruct.c multicompand.c windowbutton.c subpanel.c \
24
	feedback.c freq.c eq.c eqpanel.c compandpanel.c subband.c lpc.c \
25
	bessel.c suppresspanel.c suppress.c singlecomp.c singlepanel.c \
26
	limit.c limitpanel.c mute.c mixpanel.c mix.c reverb.c
27
OBJ = main.o mainpanel.o multibar.o readout.o input.o output.o clippanel.o \
28
	declip.o reconstruct.o multicompand.o windowbutton.o subpanel.o \
29
	feedback.o freq.o eq.o eqpanel.o compandpanel.o subband.o lpc.o \
30
	bessel.o suppresspanel.o suppress.o singlecomp.o singlepanel.o \
31 32
	limit.o limitpanel.o mute.o mixpanel.o mix.o reverb.o
GCF = -DETCDIR=\\\"$(ETCDIR)\\\" `pkg-config --cflags gtk+-2.0` -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
33 34

all:	
35
	$(MAKE) target CFLAGS="-O3 -ffast-math -fomit-frame-pointer $(GCF) $(ADD_DEF)"
36 37

debug:
38
	$(MAKE) target CFLAGS="-g -Wall -W -Wno-unused-parameter -D__NO_MATH_INLINES $(GCF) $(ADD_DEF)"
39 40

profile:
41
	$(MAKE) target CFLAGS="-pg -g -O3 -ffast-math $(GCF) $(ADD_DEF)" LIBS="-lgprof-helper "
42 43

clean:
44 45 46 47
	rm -f $(OBJ) *.d *.d.* gmon.out postfish

distclean: clean
	rm -f postfish-wisdomrc
48 49

%.d: %.c
50 51 52 53 54 55 56 57 58 59 60 61 62 63
	$(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
64

65
ifeq ($(MAKECMDGOALS),target)
66
include $(SRC:.c=.d)
67
endif
68

69
target:  $(OBJ) postfish-wisdomrc
70
	./touch-version
71
	$(LD) $(OBJ) $(CFLAGS) -o postfish $(LIBS) `pkg-config --libs gtk+-2.0` -lpthread -lfftw3f -lm 
72

73
install: target
74 75 76 77
	$(INSTALL) -d -m 0755 $(BINDIR)
	$(INSTALL) -m 0755 postfish $(BINDIR)
	$(INSTALL) -d -m 0755 $(ETCDIR)
	$(INSTALL) -m 0644 postfish-gtkrc $(ETCDIR)
78
	$(INSTALL) -m 0644 postfish-wisdomrc $(ETCDIR)
79 80 81
#	$(INSTALL) -d -m 0755 $(MANDIR)
#	$(INSTALL) -d -m 0755 $(MANDIR)/man1
#	$(INSTALL) -m 0644 postfish.1 $(MANDIR)/man1