]> gitweb.michael.orlitzky.com - apply-default-acl.git/blob - makefile
0da82fe9b941ed462eda0c4df868e4a6a9c3ed85
[apply-default-acl.git] / makefile
1 VERSION = 0.0.1
2 BIN = reapply_default_acl
3 P = $(BIN)-$(VERSION)
4 TARBALL = $(BIN)-$(VERSION).tar.bz2
5
6 CC := gcc
7 CFLAGS := -O2 -march=native -pipe -Wall
8 LIBS = -lacl
9
10 SOURCES = $(shell find ./src -type f -name '*.c')
11 HEADERS = $(shell find ./src -type f -name '*.h')
12 OBJS = $(patsubst %.c, %.o, $(SOURCES))
13
14 %.o: %.c $(HEADERS)
15 $(CC) $(CFLAGS) -c -o $@ $<
16
17 $(BIN): $(OBJS)
18 $(CC) $(CFLAGS) $(LIBS) -o $@ $^
19
20 .PHONY: clean test
21
22 clean:
23 rm -f $(OBJS)
24 rm -f $(BIN)
25 rm -f $(TARBALL)
26 rm -rf $(P)
27
28 test: $(BIN)
29 ./run-tests.sh
30
31 dist: clean
32 mkdir $(P)
33 cp -a doc makefile src $(P)
34 tar -cjf $(TARBALL) $(P)