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 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
36 ${MAKE} -C regress clean
38 regress: gmid
39 ${MAKE} TESTS=${TESTS} -C regress all
41 install: gmid
42 mkdir -p ${DESTDIR}${BINDIR}
43 mkdir -p ${DESTDIR}${MANDIR}/man1
44 ${INSTALL_PROGRAM} gmid ${DESTDIR}${BINDIR}
45 ${INSTALL_MAN} gmid.1 ${DESTDIR}${MANDIR}/man1
47 compile_flags.txt:
48 printf "%s\n" ${CFLAGS} > compile_flags.txt
50 # make sure we pass -o to ${CC}. OpenBSD default suffix rule doesn't
51 .SUFFIXES: .c .o
52 .c.o:
53 ${CC} ${CFLAGS} -c $< -o $@