Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit a76ebe6

Browse files
committed
Write the version into the .pc file at 'make install' time so we don't get@VERSION@ from source
1 parent 5320da9 commit a76ebe6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ TESTFILES=$(TESTSOURCES:.c=.t)
5151
VERSION_MAJOR=0
5252
VERSION_MINOR=20
5353

54+
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
55+
5456
VERSION_CURRENT=15
5557
VERSION_REVISION=0
5658
VERSION_AGE=14
@@ -110,7 +112,7 @@ install-inc: termkey.h
110112
install -d $(DESTDIR)$(INCDIR)
111113
install -m644 termkey.h $(DESTDIR)$(INCDIR)
112114
install -d $(DESTDIR)$(LIBDIR)/pkgconfig
113-
LIBDIR=$(LIBDIR) INCDIR=$(INCDIR) sh termkey.pc.sh >$(DESTDIR)$(LIBDIR)/pkgconfig/termkey.pc
115+
LIBDIR=$(LIBDIR) INCDIR=$(INCDIR) VERSION=$(VERSION) sh termkey.pc.sh >$(DESTDIR)$(LIBDIR)/pkgconfig/termkey.pc
114116

115117
install-lib: $(LIBRARY)
116118
install -d $(DESTDIR)$(LIBDIR)
@@ -134,8 +136,6 @@ install-man:
134136
MANSOURCE=$(wildcard man/*.3.sh)
135137
BUILTMAN=$(MANSOURCE:.3.sh=.3)
136138

137-
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR)
138-
139139
all: doc
140140

141141
doc: $(BUILTMAN)
@@ -164,7 +164,7 @@ distdir: all
164164
cp t/*.c t/*.h __distdir/t
165165
mkdir __distdir/man
166166
cp man/*.[37] man/also __distdir/man
167-
sed "s,@VERSION@,$(VERSION)," <termkey.pc.sh >__distdir/termkey.pc.sh
167+
cp termkey.pc.sh __distdir/termkey.pc.sh
168168
sed "/^# DIST CUT/Q" <Makefile >__distdir/Makefile
169169
mv __distdir $(DISTDIR)
170170

termkey.pc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ includedir=$INCDIR
44
55
Name: termkey
66
Description: Abstract terminal key input library
7-
Version: @VERSION@
7+
Version: $VERSION
88
Libs: -L\${libdir} -ltermkey
99
Cflags: -I\${includedir}
1010
EOF

0 commit comments

Comments
 (0)