enchive/Makefile

28 lines
734 B
Makefile
Raw Normal View History

2017-03-03 14:25:57 +01:00
.POSIX:
.SUFFIXES:
CC = cc
2017-03-05 04:35:48 +01:00
CFLAGS = -ansi -pedantic -Wall -Wextra -O3 -g3
2017-03-03 14:25:57 +01:00
2017-03-06 02:20:24 +01:00
sources = src/enchive.c src/chacha.c src/curve25519-donna.c src/sha256.c
2017-03-05 18:54:40 +01:00
objects = $(sources:.c=.o)
2017-03-06 02:20:24 +01:00
headers = config.h src/docs.h src/chacha.h src/sha256.h src/optparse.h
2017-03-03 14:25:57 +01:00
enchive: $(objects)
$(CC) $(LDFLAGS) -o $@ $(objects) $(LDLIBS)
2017-03-06 02:20:24 +01:00
src/enchive.o: src/enchive.c config.h src/docs.h
src/chacha.o: src/chacha.c config.h
src/curve25519-donna.o: src/curve25519-donna.c config.h
src/sha256.o: src/sha256.c config.h
2017-03-03 14:25:57 +01:00
2017-03-05 18:54:40 +01:00
enchive-cli.c: $(sources) $(headers)
2017-03-05 19:03:20 +01:00
cat $(headers) $(sources) | sed -r 's@^(#include +".+)@/* \1 */@g' > $@
2017-03-05 18:54:40 +01:00
amalgamation: enchive-cli.c
2017-03-03 14:25:57 +01:00
clean:
2017-03-05 18:54:40 +01:00
rm -f enchive $(objects) enchive-cli.c
2017-03-03 14:25:57 +01:00
.SUFFIXES: .c .o
.c.o:
$(CC) -c $(CFLAGS) -o $@ $<