2020-02-13 02:37:11 +00:00
|
|
|
VERSION := 0.9.2
|
2020-02-13 16:02:53 +00:00
|
|
|
CC ?= gcc
|
|
|
|
TARGET := ke
|
|
|
|
OBJS := main.o
|
|
|
|
LIBS := -lefence
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
MANDIR ?= /usr/local/man
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
CFLAGS += -Wall -Wextra -pedantic -Wshadow -Werror -std=c99 -g
|
|
|
|
CFLAGS += -DKE_VERSION="\"$(TARGET) version $(VERSION)\""
|
|
|
|
CFLAGS += -D_DEFAULT_SOURCE -D_POSIX_SOURCE -D_XOPEN_SOURCE
|
|
|
|
all: $(TARGET)
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
clean:
|
|
|
|
-rm -f .?*.* *.core *.o *.html tags $(TARGET) $(OBJS)
|
|
|
|
-rm -rf security
|
|
|
|
-rm -rf $(TARGET)-$(VERSION)
|
|
|
|
-rm -f $(TARGET)-$(VERSION).tgz
|
2020-02-08 10:22:31 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
${CC} -o $(TARGET) ${CFLAGS} ${LDFLAGS} $(LIBS) $(OBJS)
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
install: $(TARGET)
|
|
|
|
install -m 0755 $(TARGET) $(PREFIX)/bin/$(TARGET)
|
|
|
|
install -m 0755 -d $(MANDIR)/man1
|
|
|
|
install -m 0444 $(TARGET).1 $(MANDIR)/man1/$(TARGET).1
|
2020-02-13 02:37:11 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
uninstall:
|
|
|
|
-rm -f $(PREFIX)/bin/$(TARGET)
|
|
|
|
-rm -f $(MANDIR)/man1/$(TARGET).1
|
|
|
|
|
|
|
|
lint:
|
|
|
|
-mkdir security
|
|
|
|
-rats -w 3 $(TARGET).[ch] > security/rats.out
|
|
|
|
-lint -fhrs $(TARGET).c > security/lint.out
|
|
|
|
-splint +posixlib $(TARGET).[ch] > security/splint.out
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
dist: clean
|
|
|
|
-mkdir $(TARGET)-$(VERSION)
|
|
|
|
-cp * $(TARGET)-$(VERSION)
|
|
|
|
-cd $(TARGET)-$(VERSION) && make distclean && cd ..
|
|
|
|
-tar czf $(TARGET)-$(VERSION).tgz $(TARGET)-$(VERSION)
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
distclean: clean
|
|
|
|
-rm -f Makefile
|
2020-02-11 01:01:21 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
htmldoc:
|
|
|
|
-mandoc -Thtml $(TARGET).1 > $(TARGET).1.html
|
2020-02-13 02:37:11 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
tags:
|
|
|
|
ctags *.[ch]
|
2020-02-11 08:30:21 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
.c.o:
|
|
|
|
$(CC) -c ${CFLAGS} $?
|
2020-02-13 01:11:32 +00:00
|
|
|
|
2020-02-13 16:02:53 +00:00
|
|
|
.PHONY: clean all install lint uninstall dist distclean htmldoc tags
|