enchive/Makefile

28 lines
666 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-05 18:54:40 +01:00
sources = enchive.c chacha.c curve25519-donna.c sha256.c
objects = $(sources:.c=.o)
headers = config.h docs.h chacha.h sha256.h optparse.h
2017-03-03 14:25:57 +01:00
enchive: $(objects)
$(CC) $(LDFLAGS) -o $@ $(objects) $(LDLIBS)
2017-03-05 21:51:38 +01:00
enchive.o: enchive.c config.h docs.h
chacha.o: chacha.c config.h
curve25519-donna.o: curve25519-donna.c config.h
sha256.o: 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 $@ $<