From: Michael Orlitzky Date: Sun, 19 Aug 2012 15:49:06 +0000 (-0400) Subject: Add a 'dist' makefile target. X-Git-Tag: v0.0.1^0 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=86e280502947f452b13d502ece53b9744b43b5e1;p=apply-default-acl.git Add a 'dist' makefile target. --- diff --git a/makefile b/makefile index a0289cb..0da82fe 100644 --- a/makefile +++ b/makefile @@ -1,11 +1,15 @@ -CC = gcc -CFLAGS = -O2 -march=native -pipe -Wall +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 -BIN := reapply_default_acl -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 $@ $< @@ -18,6 +22,13 @@ $(BIN): $(OBJS) clean: rm -f $(OBJS) 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)