summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: a8c74c6a05bb7ddc83da6555c723f19823763dfb (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
CSRCS=time_fn.c msf.c util.c main.c signal.c sync.c audio.c
HSRCS=time_fn.h project.h
PROG=msf
LIBS=-lm 
CPPFLAGS=

AO_CFLAGS=$(shell pkg-config --cflags ao)
AO_LIBS=$(shell pkg-config --libs ao)

AO_CFLAGS=-Iprefix/include
AO_LIBS=prefix/lib/libao.a

LIBS+=$(AO_LIBS)
CPPFLAGS+=$(AO_CFLAGS)

CC=x86_64-w64-mingw32-gcc


#####################

OBJS=${CSRCS:%.c=%.o}


CFLAGS=-Wall ${CPPFLAGS}

CPROTO=cproto

DEPFLAGS	= -MT $@ -MMD -MP -MF $*.d

${PROG}:${OBJS}
	${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}

%.o:%.c
	${CC} ${CFLAGS} ${DEPFLAGS} -c -o $@ $<


protos:
	echo -n > prototypes.h
	${CPROTO} ${CPPFLAGS} -v -e ${CSRCS} > prototypes.h.new
	cat prototypes.h.new > prototypes.h
	/bin/rm -f prototypes.h.new

clean:
	/bin/rm -f *% *~ ${OBJS} ${PROG} *.d *.orig

tidy:
	astyle -A3 -s2 --attach-extern-c -L -c -w -Y -m0 -f -p  -H -U -k3 -xj -xd ${CSRCS} ${HSRCS} ${LXCSRCS}

-include $(patsubst %,%.d,$(basename $(CSRCS)))