aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJan Sucan <jan@jansucan.com>2021-05-01 10:28:01 +0200
committerJan Sucan <jan@jansucan.com>2021-05-01 10:28:01 +0200
commitde4112baf9b1bcfa3c6ee06cbf78f95f1a213b46 (patch)
tree1aed23c1e2359a3f0d0c02c418f072ddb9ed6e01 /Makefile
parent7a38545d0b8df7216c1300b379a51fb14374a4fa (diff)
Specify program name and version in the Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 03205f0..ff57fd7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+PROGRAM_NAME=diff-dd
+PROGRAM_VERSION=1.0
+
CC=gcc
CFLAGS=-Wall
EXEC_NAME=diff-dd
@@ -5,10 +8,14 @@ EXEC_NAME=diff-dd
SOURCES=*.c
HEADERS=*.h
-all: $(SOURCES) $(HEADERS)
+all: $(SOURCES) $(HEADERS) program_info_header
$(CC) $(CFLAGS) -o $(EXEC_NAME) $(SOURCES)
+program_info_header:
+ echo "#define PROGRAM_NAME_STR \"$(PROGRAM_NAME)\"" >program_info.h
+ echo "#define PROGRAM_VERSION_STR \"$(PROGRAM_VERSION)\"" >>program_info.h
+
.PHONY: clean
clean:
- rm -f *.o *~ $(EXEC_NAME)
+ rm -f *.o *~ $(EXEC_NAME) program_info.h