aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-09-05 19:07:58 -0300
committerEuAndreh <eu@euandre.org>2021-09-05 19:07:58 -0300
commit2d8bf12a0a7422bdedd6b27e8c1fb7c5202cb798 (patch)
treef3d53d2dd21aa7cb831cc86c18b66075436b00ea /Makefile
parentMakefile: Add better .c.o inference rule (diff)
downloadgistatic-2d8bf12a0a7422bdedd6b27e8c1fb7c5202cb798.tar.gz
gistatic-2d8bf12a0a7422bdedd6b27e8c1fb7c5202cb798.tar.xz
Makefile: Generate src/config.h from src/config.h.in
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 7 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 2f36a0b..8e6471d 100644
--- a/Makefile
+++ b/Makefile
@@ -10,10 +10,15 @@ CONTRIBLANGS =
LDLIBS = -lgit2
-.SUFFIXES: .in .to
+.SUFFIXES:
+.SUFFIXES: .c .o .to .in
.in:
- sed -e 's:@VERSION@:$(VERSION):g' -e 's:@DATE@:$(DATE):g' < $< > $@
+ sed \
+ -e 's:@VERSION@:$(VERSION):g' \
+ -e 's:@DATE@:$(DATE):g' \
+ -e 's:@NAME@:$(NAME):g' \
+ < $< > $@
.c.o:
$(CC) $(CFLAGS) -o $@ -c $<
@@ -41,7 +46,6 @@ t-objects = $(sources:.c=.to) src/tests-lib.to src/main.to
all: libgistatic.a gistatic $(manpages)
-
libgistatic.a: $(lib-objects)
$(AR) $(ARFLAGS) $@ $(lib-objects)
@@ -51,17 +55,6 @@ gistatic: libgistatic.a src/main.o
gistatic-tests: $(t-objects)
$(CC) $(LDFLAGS) -o $@ $(t-objects) $(LDLIBS)
-src/config.h:
- printf '#ifndef GISTATIC_CONFIG_H\n' >> $@
- printf '#define GISTATIC_CONFIG_H\n' >> $@
- printf '\n' >> $@
- printf '#define _POSIX_C_SOURCE 200809L\n' >> $@
- printf '#define VERSION "$(VERSION)"\n' >> $@
- printf '#define DATE "$(DATE)"\n' >> $@
- printf '#define PROGNAME "$(NAME)"\n' >> $@
- printf '\n' >> $@
- printf '#endif\n' >> $@
-
$(all-objects) $(t-objects): src/config.h
src/tests-lib.to: src/tests-lib.h
src/logerr.o src/logerr.to: src/logerr.h