1PROG = gramofile
2
3SRCS = boxes.c buttons.c checkfile.c dirfilemenu.c errorwindow.c 	\
4        gramofile.c mainmenu.c reclp_filenm.c reclp_main.c scrollmenu.c	\
5        stringinput.c textwindow.c yesnowindow.c clrscr.c helpline.c	\
6        signpr_main.c signpr_infilenm.c signpr_outfilenm.c		\
7        signpr_general.c signpr_median.c signpr_filtmenu.c signpr_wav.c	\
8	secshms.c playwav.c signpr_cmf.c signpr_mean.c signpr_doubmed.c	\
9	splashscr.c tracksplit.c tracksplit_filenm.c			\
10        tracksplit_parammenu.c signpr_cmf2.c  signpr_cmf3.c             \
11	signpr_rms.c signpr_copy.c	\
12        signpr_exper.c endian.c signpr_mono.c signpr_l1fit.c
13
14OBJS = $(SRCS:.c=.o)
15SHELL = /bin/sh
16
17CC = gcc
18LDFLAGS =
19
20########## CHOOSE YOUR ARCHITECTURE:    (NOTE: also see bplaysrc/Makefile!)
21
22# For Linux (and maybe others), use these:
23#CFLAGS = -Wall -O2 -funroll-loops -DTURBO_MEDIAN -DTURBO_BUFFER
24#DEPS = $(OBJS) makebplay
25#LIBS = -lncurses -lrfftw -lfftw -lm
26#COPY_A = -a
27
28# For FreeBSD (and maybe others), use these:
29CFLAGS += -Wall -DTURBO_MEDIAN -DTURBO_BUFFER -I${LOCALBASE}/include
30DEPS = $(OBJS) makebplay
31LIBS = -L${LOCALBASE}/lib -lncurses  -lrfftw -lfftw -lm
32COPY_A = -p
33
34# For IRIX (and maybe others), use these:
35#CFLAGS = -Wall -O2 -DTURBO_MEDIAN -DTURBO_BUFFER -DSWAP_ENDIAN -DOLD_CURSES
36#DEPS = $(OBJS)
37#LIBS = -lcurses  -lrfftw -lfftw -lm
38#COPY_A = -a
39
40##########
41
42
43$(PROG): $(DEPS)
44	$(CC) $(LDFLAGS) $(OBJS) -o $(PROG) $(LIBS)
45	@echo ''
46	@echo ''
47	@echo ''
48	@echo "  If you're one of those that didn't read the README, please do so now."
49	@echo ''
50
51makebplay: yesnowindow.o boxes.o buttons.o textwindow.o errorwindow.o \
52           clrscr.o secshms.o
53	$(MAKE) -C bplaysrc
54	-rm -f bplay_gramo brec_gramo
55	cp $(COPY_A) bplaysrc/bplay ./bplay_gramo
56	ln -s bplay_gramo brec_gramo
57
58.PHONY: perl-swig
59perl-swig:
60	$(MAKE) -C perl-swig
61
62.PHONY: clean
63clean:
64	$(MAKE) -C bplaysrc clean
65	$(MAKE) -C perl-swig clean
66	-rm -f gramofile bplay_gramo brec_gramo *.o *.d *~
67
68.PHONY: indent
69indent:
70	indent *.c *.h
71
72#%.d: %.c   - according to 'info make', doesn't work
73#	$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \
74#		      | sed '\''s/\($*\)\.o[ :]*/\1 $@/g'\'' > $@'
75#
76# 'some.o: some.c other.h'   ==> 'some some.dsome.c other.h'
77
78%.d: %.c
79	$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \
80		      | sed '\''s/\($*\)\.o/& $@/g'\'' > $@'
81#
82# 'some.o: some.c other.h'   ==> 'some.o some.d: some.c other.h'  => OK
83
84include $(SRCS:.c=.d)
85
86