summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 01a4471114b84bc569c4297ffd22da47164bfc43 (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
CSRCS=time_fn.c msf.c util.c main.c
HSRCS=time_fn.h project.h

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

PROG=msf

CPPFLAGS=
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)))