X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=makefile;h=0da82fe9b941ed462eda0c4df868e4a6a9c3ed85;hb=3a4c697a608a23e11b84d897883b2870f9587dfa;hp=d6be6c5a2e589ed8a74153be6199128b14957e42;hpb=b3babd5135c8683e68ce97cc76e0ec0487d4ee46;p=apply-default-acl.git diff --git a/makefile b/makefile index d6be6c5..0da82fe 100644 --- a/makefile +++ b/makefile @@ -1,17 +1,34 @@ -CC = gcc -CFLAGS = -O2 -march=native -pipe +VERSION = 0.0.1 +BIN = reapply_default_acl +P = $(BIN)-$(VERSION) +TARBALL = $(BIN)-$(VERSION).tar.bz2 + +CC := gcc +CFLAGS := -O2 -march=native -pipe -Wall LIBS = -lacl -SOURCES := $(shell find ./src -type f -name '*.c') -HEADERS := $(shell find ./src -type f -name '*.h') -OBJS := $(patsubst %.c, %.o, $(SOURCES)) +SOURCES = $(shell find ./src -type f -name '*.c') +HEADERS = $(shell find ./src -type f -name '*.h') +OBJS = $(patsubst %.c, %.o, $(SOURCES)) %.o: %.c $(HEADERS) $(CC) $(CFLAGS) -c -o $@ $< -aclq: $(OBJS) +$(BIN): $(OBJS) $(CC) $(CFLAGS) $(LIBS) -o $@ $^ +.PHONY: clean test + clean: rm -f $(OBJS) - rm -f aclq + rm -f $(BIN) + rm -f $(TARBALL) + rm -rf $(P) + +test: $(BIN) + ./run-tests.sh + +dist: clean + mkdir $(P) + cp -a doc makefile src $(P) + tar -cjf $(TARBALL) $(P)