diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 52 |
1 files changed, 15 insertions, 37 deletions
diff --git a/Makefile b/Makefile index e66c045..f499b2d 100644 --- a/Makefile +++ b/Makefile @@ -1,52 +1,30 @@ .POSIX: -.SUFFIXES: .c .o BIN = rf -VERSION = 0.0.3 -OBJS = rf.o -MANPAGE = rf.1 +VERSION = 0.0.5 +OBJS = rf.o ignore.o +PREFIX = /usr/local CC = cc -DEPS = config.h -LIBS = -INC = -CFLAGS := ${CFLAGS} -CFLAGS += -std=c99 \ - -Wpedantic \ - -Wall \ - -Werror=format-security \ - -Werror=implicit-function-declaration \ - -O2 \ - -fstack-protector-strong \ - -fpie \ +CFLAGS = -std=c99 -O2 \ + -Wpedantic -Wall \ + -fstack-protector-strong -fpie \ -D_FORTIFY_SOURCE=2 \ - -D_DEFAULT_SOURCE \ -DVERSION='"$(VERSION)"' \ - -DNAME='"$(BIN)"' \ - $(INC) $(LIBS) -PREFIX ?= /usr/local + -DNAME='"$(BIN)"' build: $(BIN) $(BIN): $(OBJS) - $(CC) $(BIN).c $(CFLAGS) -o $(BIN) - -debug: $(OBJS) - $(CC) $(BIN).c $(CFLAGS) -g -o $(BIN) - -test: clean debug - valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 ./$(BIN) ^$ - valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 ./$(BIN) ^$$ - valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 ./$(BIN) rf - -static: $(OBJS) - $(CC) $(BIN).c $(CFLAGS) -static -o $(BIN) - -%.o: %.c $(DEPS) - $(CC) -c -o $@ $< $(CFLAGS) + $(CC) $(CFLAGS) -o $(BIN) $(OBJS) install: build - install -Dm755 $(BIN) $(DESTDIR)$(PREFIX)/bin/ - install -Dm444 $(MANPAGE) $(DESTDIR)$(PREFIX)/man/man1/$(MANPAGE) + mkdir -p \ + $(DESTDIR)$(PREFIX)/bin \ + $(DESTDIR)$(PREFIX)/man/man1 \ + $(DESTDIR)$(PREFIX)/man/man5 + install -m755 $(BIN) $(DESTDIR)$(PREFIX)/bin/ + install -m444 rf.1 $(DESTDIR)$(PREFIX)/man/man1/ + install -m444 rfignore.5 $(DESTDIR)$(PREFIX)/man/man5/ clean: rm -vf $(BIN) *.o |