enchive/Makefile

28 lines
630 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-03 19:08:36 +01:00
enchive.o: enchive.c docs.h
2017-03-03 14:25:57 +01:00
chacha.o: chacha.c
2017-03-03 16:28:45 +01:00
curve25519-donna.o: curve25519-donna.c
2017-03-03 17:22:36 +01:00
sha256.o: sha256.c
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 $@ $<