2020-10-02 19:39:00 +02:00
|
|
|
CC = cc
|
|
|
|
CFLAGS = -Wall -Wextra -g
|
|
|
|
LDFLAGS = -ltls
|
2021-01-15 10:17:43 +01:00
|
|
|
LEX = lex
|
|
|
|
YACC = yacc
|
2020-10-02 19:39:00 +02:00
|
|
|
|
2021-01-17 13:12:37 +01:00
|
|
|
PREFIX = /usr/local
|
|
|
|
|
|
|
|
# /usr/local/lib on FreeBSD
|
|
|
|
LIBDIR = /usr/lib/
|
|
|
|
|
|
|
|
.PHONY: all static clean test install
|
2020-10-02 19:39:00 +02:00
|
|
|
|
|
|
|
all: gmid TAGS README.md
|
|
|
|
|
2021-01-15 10:17:43 +01:00
|
|
|
lex.yy.c: lex.l y.tab.c
|
|
|
|
${LEX} lex.l
|
|
|
|
|
|
|
|
y.tab.c: parse.y
|
|
|
|
${YACC} -b y -d parse.y
|
|
|
|
|
2021-01-18 00:23:58 +01:00
|
|
|
OBJS = gmid.o iri.o utf8.o lex.yy.o y.tab.o ex.o server.o sandbox.o
|
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}
|
|
|
|
${CC} -static ${OBJS} \
|
|
|
|
${LIBDIR}/libcrypto.a ${LIBDIR}/libtls.a ${LIBDIR}/libssl.a \
|
|
|
|
-o gmid
|
|
|
|
strip gmid
|
|
|
|
|
2021-01-18 00:23:58 +01:00
|
|
|
TAGS: gmid.c iri.c utf8.c ex.c server.c sandbox.c
|
|
|
|
-etags gmid.c iri.c utf8.c ex.c server.c sandbox.c || true
|
2020-10-02 19:39:00 +02:00
|
|
|
|
|
|
|
clean:
|
2021-01-15 10:17:43 +01:00
|
|
|
rm -f *.o lex.yy.c y.tab.c y.tab.h y.output gmid iri_test
|
2020-12-25 13:13:12 +01:00
|
|
|
|
2021-01-11 14:08:00 +01:00
|
|
|
iri_test: iri_test.o iri.o utf8.o
|
|
|
|
${CC} iri_test.o iri.o utf8.o -o iri_test ${LDFLAGS}
|
2020-12-25 13:13:12 +01:00
|
|
|
|
2021-01-17 12:34:06 +01:00
|
|
|
test: gmid iri_test
|
|
|
|
@echo "IRI tests"
|
|
|
|
@echo "=============================="
|
2021-01-11 14:08:00 +01:00
|
|
|
./iri_test
|
2021-01-17 12:34:06 +01:00
|
|
|
@echo
|
|
|
|
@echo "server tests"
|
|
|
|
@echo "=============================="
|
|
|
|
cd test && ./test.sh
|
2021-01-17 13:12:37 +01:00
|
|
|
|
|
|
|
install: gmid
|
|
|
|
install -o root -g wheel -m 0755 gmid ${PREFIX}/bin/
|
|
|
|
install -o root -g wheel -m 0644 gmid.1 ${PREFIX}/man/man1
|