Blob


1 # tests to run as a port of the regression suite. Leave empty to run
2 # all.
3 TESTS=
5 .PHONY: all static clean regress install
7 all: Makefile.local gmid TAGS compile_flags.txt
9 Makefile.local: configure
10 ./configure
12 include Makefile.local
14 y.tab.c: parse.y
15 ${YACC} -b y parse.y
17 SRCS = gmid.c iri.c utf8.c ex.c server.c sandbox.c mime.c puny.c \
18 utils.c log.c dirs.c fcgi.c
19 OBJS = ${SRCS:.c=.o} y.tab.o ${COMPAT}
21 gmid: ${OBJS}
22 ${CC} ${OBJS} -o gmid ${LDFLAGS}
24 static: ${OBJS}
25 ${CC} ${OBJS} -o gmid ${LDFLAGS} ${STATIC}
27 TAGS: ${SRCS}
28 @(etags ${SRCS} || true) 2>/dev/null
30 clean:
31 rm -f *.o compat/*.o y.tab.c y.tab.h y.output gmid
32 rm -f compile_flags.txt
33 ${MAKE} -C regress clean
35 regress: gmid
36 ${MAKE} TESTS=${TESTS} -C regress all
38 install: gmid
39 mkdir -p ${DESTDIR}${BINDIR}
40 mkdir -p ${DESTDIR}${MANDIR}/man1
41 ${INSTALL_PROGRAM} gmid ${DESTDIR}${BINDIR}
42 ${INSTALL_MAN} gmid.1 ${DESTDIR}${MANDIR}/man1
44 compile_flags.txt:
45 printf "%s\n" ${CFLAGS} > compile_flags.txt
47 # make sure we pass -o to ${CC}. OpenBSD default suffix rule doesn't
48 .SUFFIXES: .c .o
49 .c.o:
50 ${CC} ${CFLAGS} -c $< -o $@