Skip to content

Commit

Permalink
Introduce <twopence/version.h
Browse files Browse the repository at this point in the history
Signed-off-by: Olaf Kirch <[email protected]>
  • Loading branch information
okirch committed Sep 28, 2015
1 parent bf05c7b commit b1da29a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.o
*.gem
*.swp
library/version.h
shell/command
shell/exit
shell/extract
Expand Down
13 changes: 10 additions & 3 deletions library/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,26 @@ LIB_OBJS= twopence.o \
buffer.o \
logging.o \
utils.o
HEADERS = buffer.h \
twopence.h \
version.h

all: libtwopence.so

libtwopence.so: twopence.h $(LIB_OBJS) Makefile
libtwopence.so: $(HEADERS) $(LIB_OBJS) Makefile
$(CC) $(CFLAGS) -o $@ --shared -Wl,-soname,libtwopence.so.0 $(LIB_OBJS) -lssh

install: libtwopence.so twopence.h
install: libtwopence.so $(HEADERS)
mkdir -p $(DESTDIR)$(LIBDIR)
install -m555 libtwopence.so $(DESTDIR)$(LIBDIR)/libtwopence.so.$(VERSION)
mkdir -p $(DESTDIR)$(INCDIR)/twopence
install -m444 twopence.h buffer.h $(DESTDIR)$(INCDIR)/twopence
install -m444 $(HEADERS) $(DESTDIR)$(INCDIR)/twopence
mkdir -p $(DESTDIR)$(MANDIR)/man3
gzip -c twopence.3 > $(DESTDIR)$(MANDIR)/man3/twopence.3.gz

version.h: version.h.in
sed 's:@VERSION@:$(VERSION):g' $< > $@

clean:
rm -f *.o *.so
rm -f version.h
25 changes: 25 additions & 0 deletions library/version.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Twopence version header file

Copyright (C) 2014-2015 SUSE

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 2.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef TWOPENCE_VERSION_H
#define TWOPENCE_VERSION_H

#define TWOPENCE_VERSION "@VERSION@"

#endif /* TWOPENCE_VERSION_H */

0 comments on commit b1da29a

Please sign in to comment.