mirror of
https://github.com/omar-polo/gmid.git
synced 2024-08-18 00:43:22 +02:00
even the message "sh: etags: not such file or directory" or whatever seems to be confusing for users, so silent it. (maybe it would be better not to automatically generate the TAGS, but it's so handy...)
52 lines
1.1 KiB
Makefile
52 lines
1.1 KiB
Makefile
.PHONY: all static clean regress install
|
|
|
|
all: Makefile.local gmid TAGS compile_flags.txt
|
|
|
|
Makefile.local: configure
|
|
./configure
|
|
|
|
include Makefile.local
|
|
|
|
lex.yy.c: lex.l y.tab.c
|
|
${LEX} lex.l
|
|
|
|
y.tab.c: parse.y
|
|
${YACC} -b y -d parse.y
|
|
|
|
SRCS = gmid.c iri.c utf8.c ex.c server.c sandbox.c mime.c puny.c utils.c log.c
|
|
OBJS = ${SRCS:.c=.o} lex.yy.o y.tab.o ${COMPAT}
|
|
|
|
gmid: ${OBJS}
|
|
${CC} ${OBJS} -o gmid ${LDFLAGS}
|
|
|
|
gg: gg.o iri.o utf8.o ${COMPAT}
|
|
${CC} gg.o iri.o utf8.o ${COMPAT} -o $@ ${LDFLAGS}
|
|
|
|
static: ${OBJS}
|
|
${CC} ${OBJS} -o gmid ${LDFLAGS} ${STATIC}
|
|
|
|
TAGS: ${SRCS}
|
|
@(etags ${SRCS} || true) 2>/dev/null
|
|
|
|
clean:
|
|
rm -f *.o compat/*.o lex.yy.c y.tab.c y.tab.h y.output gmid gg
|
|
rm -f compile_flags.txt
|
|
make -C regress clean
|
|
|
|
regress: gmid gg
|
|
make -C regress all
|
|
|
|
install: gmid
|
|
mkdir -p ${DESTDIR}${BINDIR}
|
|
mkdir -p ${DESTDIR}${MANDIR}/man1
|
|
${INSTALL_PROGRAM} gmid ${DESTDIR}${BINDIR}
|
|
${INSTALL_MAN} gmid.1 ${DESTDIR}${MANDIR}/man1
|
|
|
|
compile_flags.txt:
|
|
printf "%s\n" ${CFLAGS} > compile_flags.txt
|
|
|
|
# make sure we pass -o to ${CC}. OpenBSD default suffix rule doesn't
|
|
.SUFFIXES: .c .o
|
|
.c.o:
|
|
${CC} ${CFLAGS} -c $< -o $@
|