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 cleanall regress install
7 all: Makefile.local gmid gg 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 proxy.c
19 OBJS = ${SRCS:.c=.o} y.tab.o ${COMPAT}
21 gmid: ${OBJS}
22 ${CC} ${OBJS} -o gmid ${LDFLAGS}
24 gg: gg.o iri.o utf8.o ${COMPAT}
25 ${CC} gg.o iri.o utf8.o ${COMPAT} -o $@ ${LDFLAGS}
27 static: ${OBJS}
28 ${CC} ${OBJS} -o gmid ${LDFLAGS} ${STATIC}
30 TAGS: ${SRCS}
31 @(etags ${SRCS} || true) 2>/dev/null
33 clean:
34 rm -f *.o compat/*.o y.tab.c y.tab.h y.output gmid
35 rm -f compile_flags.txt
37 cleanall: clean
38 ${MAKE} -C regress clean
40 regress: gmid
41 ${MAKE} 'TESTS=${TESTS}' -C regress all
43 install: gmid
44 mkdir -p ${DESTDIR}${BINDIR}
45 mkdir -p ${DESTDIR}${MANDIR}/man1
46 ${INSTALL_PROGRAM} gmid ${DESTDIR}${BINDIR}
47 ${INSTALL_MAN} gmid.1 ${DESTDIR}${MANDIR}/man1
49 compile_flags.txt:
50 printf "%s\n" ${CFLAGS} > compile_flags.txt
52 # make sure we pass -o to ${CC}. OpenBSD default suffix rule doesn't
53 .SUFFIXES: .c .o
54 .c.o:
55 ${CC} ${CFLAGS} -c $< -o $@