From 4bdd1c3e006bd859d5d43d1318e39133c0d2d7f4 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Sat, 9 Aug 2008 22:10:54 +0000 Subject: [PATCH] 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 --- Makefile | 22 ++++++++++------------ docs/Makefile | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 docs/Makefile diff --git a/Makefile b/Makefile index 673ac04..4fe3c62 100644 --- a/Makefile +++ b/Makefile @@ -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 $@ $< diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..09babbb --- /dev/null +++ b/docs/Makefile @@ -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 $<