2018-06-06 10:56:44 +02:00
|
|
|
PREFIX=/usr
|
|
|
|
|
2018-05-13 17:21:51 +02:00
|
|
|
.PHONY: main test install uninstall clean
|
2018-04-25 14:29:11 +02:00
|
|
|
|
2018-06-09 16:20:43 +02:00
|
|
|
CFLAGS := -Wall
|
2018-05-19 16:51:25 +02:00
|
|
|
SRCFILES := $(shell find . -type f -name "*.c")
|
|
|
|
OBJFILES := $(patsubst %.c, %.o, $(SRCFILES))
|
2018-04-26 18:49:23 +02:00
|
|
|
|
|
|
|
|
2018-07-26 14:43:38 +02:00
|
|
|
all: iast doc/iast.1.gz
|
|
|
|
|
2018-05-19 16:51:25 +02:00
|
|
|
iast: main.o $(OBJFILES)
|
2018-06-09 16:20:43 +02:00
|
|
|
$(CC) $^ -o $@ $(CFLAGS)
|
2018-04-25 14:29:11 +02:00
|
|
|
|
2018-05-13 17:15:26 +02:00
|
|
|
test: iast
|
2018-05-03 19:13:34 +02:00
|
|
|
sh tests/test.sh
|
2018-04-26 13:39:53 +02:00
|
|
|
|
2018-04-26 18:49:23 +02:00
|
|
|
%.o: %.c
|
2018-06-09 16:20:43 +02:00
|
|
|
$(CC) -MMD -MP -c $< -o $@ $(CFLAGS)
|
2018-04-26 18:49:23 +02:00
|
|
|
|
2018-07-26 14:43:38 +02:00
|
|
|
doc/%.gz: doc/%.adoc
|
|
|
|
asciidoctor -d manpage -b manpage $< -o $(<:.adoc=) && gzip -f $(<:.adoc=)
|
|
|
|
|
2018-05-13 17:21:51 +02:00
|
|
|
install:
|
2018-06-06 10:56:44 +02:00
|
|
|
install -m 0755 iast $(PREFIX)/bin
|
2018-07-26 14:43:38 +02:00
|
|
|
install -m 644 doc/iast.1.gz $(PREFIX)/share/man/man1
|
2018-05-13 17:21:51 +02:00
|
|
|
|
|
|
|
uninstall:
|
2018-06-06 10:56:44 +02:00
|
|
|
rm -f $(PREFIX)/bin/iast
|
2018-07-26 14:43:38 +02:00
|
|
|
rm -f $(PREFIX)/share/man/man1/$(PROGNAME).1.gz
|
2018-05-13 17:21:51 +02:00
|
|
|
|
2018-04-25 14:29:11 +02:00
|
|
|
clean:
|
2018-07-26 14:43:38 +02:00
|
|
|
$(RM) iast *.o *.d doc/*.gz
|