2021-10-07 10:55:44 +02:00
|
|
|
# tests to run as a port of the regression suite. Leave empty to run
|
|
|
|
# all.
|
|
|
|
TESTS=
|
|
|
|
|
2021-01-22 17:48:04 +01:00
|
|
|
.PHONY: all static clean regress install
|
2021-01-17 13:12:37 +01:00
|
|
|
|
2021-02-01 20:30:38 +01:00
|
|
|
all: Makefile.local gmid TAGS compile_flags.txt
|
2021-01-17 13:12:37 +01:00
|
|
|
|
2021-01-21 12:57:46 +01:00
|
|
|
Makefile.local: configure
|
|
|
|
./configure
|
2020-10-02 19:39:00 +02:00
|
|
|
|
2021-01-21 12:57:46 +01:00
|
|
|
include Makefile.local
|
2020-10-02 19:39:00 +02:00
|
|
|
|
2021-01-15 10:17:43 +01:00
|
|
|
y.tab.c: parse.y
|
2021-06-16 16:43:16 +02:00
|
|
|
${YACC} -b y parse.y
|
2021-01-15 10:17:43 +01:00
|
|
|
|
2021-04-25 14:06:54 +02:00
|
|
|
SRCS = gmid.c iri.c utf8.c ex.c server.c sandbox.c mime.c puny.c \
|
2021-05-09 20:23:36 +02:00
|
|
|
utils.c log.c dirs.c fcgi.c
|
2021-06-16 16:43:16 +02:00
|
|
|
OBJS = ${SRCS:.c=.o} y.tab.o ${COMPAT}
|
2021-01-18 19:18:57 +01:00
|
|
|
|
2021-01-15 15:03:45 +01:00
|
|
|
gmid: ${OBJS}
|
|
|
|
${CC} ${OBJS} -o gmid ${LDFLAGS}
|
2020-10-02 19:39:00 +02:00
|
|
|
|
2021-01-17 13:12:37 +01:00
|
|
|
static: ${OBJS}
|
2021-03-29 11:42:06 +02:00
|
|
|
${CC} ${OBJS} -o gmid ${LDFLAGS} ${STATIC}
|
2021-01-17 13:12:37 +01:00
|
|
|
|
2021-01-18 19:18:57 +01:00
|
|
|
TAGS: ${SRCS}
|
2021-04-14 17:06:27 +02:00
|
|
|
@(etags ${SRCS} || true) 2>/dev/null
|
2020-10-02 19:39:00 +02:00
|
|
|
|
|
|
|
clean:
|
2021-06-16 17:00:52 +02:00
|
|
|
rm -f *.o compat/*.o y.tab.c y.tab.h y.output gmid
|
2021-02-01 20:30:38 +01:00
|
|
|
rm -f compile_flags.txt
|
2021-07-10 23:43:21 +02:00
|
|
|
${MAKE} -C regress clean
|
2020-12-25 13:13:12 +01:00
|
|
|
|
2021-05-24 15:48:55 +02:00
|
|
|
regress: gmid
|
2021-10-07 10:55:44 +02:00
|
|
|
${MAKE} TESTS=${TESTS} -C regress all
|
2021-01-22 17:48:04 +01:00
|
|
|
|
2021-01-17 13:12:37 +01:00
|
|
|
install: gmid
|
2021-01-21 14:50:11 +01:00
|
|
|
mkdir -p ${DESTDIR}${BINDIR}
|
|
|
|
mkdir -p ${DESTDIR}${MANDIR}/man1
|
|
|
|
${INSTALL_PROGRAM} gmid ${DESTDIR}${BINDIR}
|
2021-01-30 15:38:32 +01:00
|
|
|
${INSTALL_MAN} gmid.1 ${DESTDIR}${MANDIR}/man1
|
2021-02-01 20:30:38 +01:00
|
|
|
|
|
|
|
compile_flags.txt:
|
|
|
|
printf "%s\n" ${CFLAGS} > compile_flags.txt
|
2021-02-23 12:19:52 +01:00
|
|
|
|
|
|
|
# make sure we pass -o to ${CC}. OpenBSD default suffix rule doesn't
|
|
|
|
.SUFFIXES: .c .o
|
|
|
|
.c.o:
|
|
|
|
${CC} ${CFLAGS} -c $< -o $@
|