PREFIX ?= /usr/local WFLAGS ?= -Wall -Wextra -Wmissing-prototypes -Wdiv-by-zero -Wbad-function-cast -Wcast-align -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wnested-externs -Wno-unknown-pragmas -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wno-type-limits CFLAGS ?= -O3 -mtune=native -fno-exceptions -flto $(WFLAGS) CPPFLAGS += -I. -Iext STRIP ?= strip OBJ = ext/tweetnacl.o ext/tweetpwhash.o ext/util.o src/tweetpipe.o src/safe_rw.o SRC = \ ext/tweetnacl.c \ ext/tweetpwhash.c \ ext/util.c \ src/common.h \ src/tweetpipe.c \ src/tweetpipe_p.h \ src/safe_rw.c \ src/safe_rw.h all: bin test bin: tweetpipe $(OBJ): $(SRC) .c.o: $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< tweetpipe: $(OBJ) $(CC) $(CFLAGS) -o tweetpipe $(LDFLAGS) $(OBJ) install: all -$(STRIP) --strip-all tweetpipe 2> /dev/null || $(STRIP) tweetpipe 2> /dev/null mkdir -p $(PREFIX)/bin install -o 0 -g 0 -m 0755 tweetpipe $(PREFIX)/bin 2> /dev/null || install -m 0755 tweetpipe $(PREFIX)/bin uninstall: rm -f $(PREFIX)/bin/tweetpipe test: bin @echo test | ./tweetpipe -e -p password | ./tweetpipe -d -p password -o /dev/null .PHONY: clean clean: rm -f tweetpipe $(OBJ) distclean: clean .SUFFIXES: .c .o check: test distclean: clean