Small Makefile improvements, and added missing docs/Makefile.

git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@235 bc163920-b10d-0410-b2c5-a5491ca2ceef
This commit is contained in:
Dag Wieers 2008-08-09 22:10:54 +00:00
parent cebf3bf5ad
commit 4bdd1c3e00
2 changed files with 36 additions and 12 deletions

View file

@ -1,9 +1,6 @@
# Makefile for proxytunnel
#
# Please uncomment the appropriate settings
name = proxytunnel
#version = 1.9.0
version = $(shell awk 'BEGIN { FS="\"" } /^\#define VERSION / { print $$2 }' config.h)
CC ?= cc
CFLAGS ?= -Wall -O2 -ggdb
@ -49,12 +46,13 @@ SSL_LIBS := -lssl -lcrypto
endif
LDFLAGS += $(SSL_LIBS)
PREFIX =/usr/local
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
MANDIR = $(DATADIR)/man
name = proxytunnel
version = $(shell awk 'BEGIN { FS="\"" } /^\#define VERSION / { print $$2 }' config.h)
PROGNAME = proxytunnel
prefix = /usr/local
bindir = $(prefix)/bin
datadir = $(prefix)/share
mandir = $(datadir)/man
# Remove strlcpy/strlcat on (open)bsd/darwin systems
OBJ = proxytunnel.o \
@ -80,15 +78,15 @@ docs:
$(MAKE) -C docs
proxytunnel: $(OBJ)
$(CC) -o $(PROGNAME) $(CFLAGS) $(OPTFLAGS) $(OBJ) $(LDFLAGS)
$(CC) -o $(name) $(CFLAGS) $(OPTFLAGS) $(OBJ) $(LDFLAGS)
clean:
@rm -f $(PROGNAME) $(OBJ)
@rm -f $(name) $(OBJ)
$(MAKE) -C docs clean
install:
install -Dp -m0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
install -Dp -m0644 $(PROGNAME).1 $(DESTDIR)$(MANDIR)/man1/$(PROGNAME).1
install -Dp -m0755 $(name) $(DESTDIR)$(bindir)/$(name)
$(MAKE) -C docs install
.c.o:
$(CC) $(CFLAGS) $(OPTFLAGS) -c -o $@ $<

26
docs/Makefile Normal file
View file

@ -0,0 +1,26 @@
prefix = /usr/local
datadir = $(prefix)/share
mandir = $(datadir)/man
txttargets = $(shell echo *.txt)
htmltargets = $(patsubst %.txt, %.html, $(txttargets))
docs: proxytunnel.1 $(htmltargets)
install: proxytunnel.1
install -Dp -m0644 proxytunnel.1 $(DESTDIR)$(mandir)/man1/proxytunnel.1
clean:
rm -f proxytunnel.1 *.html *.xml
%.1.html: %.1.txt
asciidoc -d manpage $<
%.1: %.1.xml
xmlto man $<
%.html: %.txt
asciidoc $<
%.1.xml: %.1.txt
asciidoc -b docbook -d manpage $<