diff --git a/doc/DMC-S1KDTOOLS-A-00-00-00-00A-920A-D_EN-CA.XML b/doc/DMC-S1KDTOOLS-A-00-00-00-00A-920A-D_EN-CA.XML index 69a00112..e34f413c 100644 --- a/doc/DMC-S1KDTOOLS-A-00-00-00-00A-920A-D_EN-CA.XML +++ b/doc/DMC-S1KDTOOLS-A-00-00-00-00A-920A-D_EN-CA.XML @@ -254,26 +254,26 @@ The following parameters can be given to make to control certain options when building and installing. - <verbatimText>PREFIX</verbatimText> + <verbatimText>prefix</verbatimText> - The PREFIX variable determines where the s1kd-tools are installed when running make install, and where they are uninstalled from when running make uninstall. The default value is /usr/local. + The prefix variable determines where the s1kd-tools are installed when running make install, and where they are uninstalled from when running make uninstall. The default value is /usr/local. Example: - # make PREFIX=/usr install - # make PREFIX=/usr uninstall + # make prefix=/usr install + # make prefix=/usr uninstall - <verbatimText>XPATH2_ENGINE</verbatimText> + <verbatimText>xpath2_engine</verbatimText> - The XPATH2_ENGINE variable determines which XPath 2.0 implementation the s1kd-brexcheck tool will use to evaluate the object paths of BREX rules. + The xpath2_engine variable determines which XPath 2.0 implementation the s1kd-brexcheck tool will use to evaluate the object paths of BREX rules. The s1kd-tools are built on libxml, so by default s1kd-brexcheck uses libxml's XPath implementation. However, libxml only supports XPath 1.0. While as of Issue 5.0, the S1000D default BREX rules are all compatible with XPath 1.0, Issue 4.0 and up do reference the XPath 2.0 specification. Therefore, if your project needs XPath 2.0 support for BREX rules, you should select one of these implementations: - SAXON + saxon Experimental implementation using the Saxon/C library. Slower, and Saxon/C itself is a very large dependency. Not recommended at this time due to memory leak issues. @@ -281,7 +281,7 @@ - XQILLA + xqilla Experimental implementation using the Xerces-C and XQilla libraries. A little slower than libxml, but faster than Saxon/C, and the dependencies are much smaller than the latter. This is currently the recommended implementation if you need XPath 2.0 support. @@ -291,7 +291,7 @@ Example: - $ make XPATH2_ENGINE=XQILLA + $ make xpath2_engine=xqilla diff --git a/doc/Makefile b/doc/Makefile index dcbf3762..57e50dd8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -21,9 +21,9 @@ PANDOC_MD=pandoc -f docbook -t gfm -s PANDOC_MD_TOC=pandoc -f docbook -t markdown | pandoc -f markdown -t gfm -s --toc PANDOC_MAN=pandoc -f docbook -t man -s -PREFIX=/usr/local -MAN1_PREFIX=$(PREFIX)/share/man/man1 -MAN5_PREFIX=$(PREFIX)/share/man/man5 +prefix=/usr/local +man1_prefix=$(prefix)/share/man/man1 +man5_prefix=$(prefix)/share/man/man5 INSTALL=install -D all: @@ -68,9 +68,9 @@ maintainer-clean: rm -f s1kd-tools.1 s1kd-defaults.5 $(README) $(INTRO) $(DEFAULTS) $(INSTALL_DOC) $(EXAMPLE) $(COMPAT) install: - $(INSTALL) s1kd-tools.1 $(MAN1_PREFIX)/s1kd-tools.1 - $(INSTALL) s1kd-defaults.5 $(MAN5_PREFIX)/s1kd-defaults.5 + $(INSTALL) s1kd-tools.1 $(man1_prefix)/s1kd-tools.1 + $(INSTALL) s1kd-defaults.5 $(man5_prefix)/s1kd-defaults.5 uninstall: - rm -f $(MAN1_PREFIX)/s1kd-tools.1 - rm -f $(MAN5_PREFIX)/s1kd-defaults.5 + rm -f $(man1_prefix)/s1kd-tools.1 + rm -f $(man5_prefix)/s1kd-defaults.5 diff --git a/tools/s1kd-acronyms/Makefile b/tools/s1kd-acronyms/Makefile index 6802b733..755dd787 100644 --- a/tools/s1kd-acronyms/Makefile +++ b/tools/s1kd-acronyms/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-acronyms.c $(COMMON)/s1kd_tools.c +sources = s1kd-acronyms.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-acronyms.exe + executable = s1kd-acronyms.exe else - OUTPUT=s1kd-acronyms + executable = s1kd-acronyms endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) stylesheets.h: stylesheets/*.xsl > $@ && for f in $+; do xxd -i "$$f" >> $@; done -$(OUTPUT): $(SOURCE) stylesheets.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) stylesheets.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) stylesheets.h + $(RM) $(executable) stylesheets.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(output) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-acronyms/doc/Makefile b/tools/s1kd-acronyms/doc/Makefile index 52c2e880..b3a575d6 100644 --- a/tools/s1kd-acronyms/doc/Makefile +++ b/tools/s1kd-acronyms/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-20-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-acronyms.1 -README=../README.md +source = DMC-S1KDTOOLS-A-20-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-acronyms.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) +all: $(manpage) $(readme) + +$(readme): $(source) s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ -$(OUTPUT): $(SOURCE) +$(manpage): $(source) s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-addicn/Makefile b/tools/s1kd-addicn/Makefile index c94e3bb9..0cda4326 100644 --- a/tools/s1kd-addicn/Makefile +++ b/tools/s1kd-addicn/Makefile @@ -1,52 +1,55 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-addicn.c $(COMMON)/s1kd_tools.c +sources = s1kd-addicn.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-addicn.exe + executable = s1kd-addicn.exe else - OUTPUT=s1kd-addicn + executable = s1kd-addicn endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags=-Wall -Werror -pedantic-errors + +CFLAGS=$(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-addicn/doc/Makefile b/tools/s1kd-addicn/doc/Makefile index 7a71e12f..300157fe 100644 --- a/tools/s1kd-addicn/doc/Makefile +++ b/tools/s1kd-addicn/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-27-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-addicn.1 -README=../README.md +source = DMC-S1KDTOOLS-A-27-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-addicn.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -s1kd-addicn.1: $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-appcheck/Makefile b/tools/s1kd-appcheck/Makefile index 480bea6d..dc0342cd 100644 --- a/tools/s1kd-appcheck/Makefile +++ b/tools/s1kd-appcheck/Makefile @@ -1,38 +1,41 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-appcheck.c $(COMMON)/s1kd_tools.c +sources = s1kd-appcheck.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-appcheck.exe + executable = s1kd-appcheck.exe else - OUTPUT=s1kd-appcheck + executable = s1kd-appcheck endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt libexslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt libexslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt libexslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt libexslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) stylesheets.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) stylesheets.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) stylesheets.h: combos.xsl stats.xsl duplicate.xsl clean-duplicate.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done @@ -41,15 +44,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) stylesheets.h + $(RM) $(executable) stylesheets.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-appcheck/doc/Makefile b/tools/s1kd-appcheck/doc/Makefile index 3cd16831..5c7fc1dd 100644 --- a/tools/s1kd-appcheck/doc/Makefile +++ b/tools/s1kd-appcheck/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-11-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-appcheck.1 -README=../README.md +source = DMC-S1KDTOOLS-A-11-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-appcheck.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-aspp/Makefile b/tools/s1kd-aspp/Makefile index df8727fd..f4796a0f 100644 --- a/tools/s1kd-aspp/Makefile +++ b/tools/s1kd-aspp/Makefile @@ -1,38 +1,41 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-aspp.c $(COMMON)/s1kd_tools.c +sources = s1kd-aspp.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-aspp.exe + executable = s1kd-aspp.exe else - OUTPUT=s1kd-aspp + executable = s1kd-aspp endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt libexslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt libexslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(COMMON)/msys endif ifeq ($(DEBUG),1) - CFLAGS+=-g + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt libexslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt libexslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) resources.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) resources.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) resources.h: elements.list disptext.xsl disptext.xml addTags.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done @@ -41,15 +44,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) resources.h + $(RM) $(executable) resources.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-aspp/doc/Makefile b/tools/s1kd-aspp/doc/Makefile index 11482cd3..bc7eac23 100644 --- a/tools/s1kd-aspp/doc/Makefile +++ b/tools/s1kd-aspp/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-26-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-aspp.1 -README=../README.md +source = DMC-S1KDTOOLS-A-26-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-aspp.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-brexcheck/Makefile b/tools/s1kd-brexcheck/Makefile index 306385b0..886bb42e 100644 --- a/tools/s1kd-brexcheck/Makefile +++ b/tools/s1kd-brexcheck/Makefile @@ -1,116 +1,119 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-brexcheck.c $(COMMON)/s1kd_tools.c +sources = s1kd-brexcheck.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-brexcheck.exe + executable = s1kd-brexcheck.exe else - OUTPUT=s1kd-brexcheck + executable = s1kd-brexcheck endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt libexslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt libexslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g -DDEBUG +ifeq ($(debug),1) + CFLAGS += -g -DDEBUG else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt libexslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt libexslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -XPATH2_ENGINE=NONE +xpath2_engine = none -ifeq ($(XPATH2_ENGINE),SAXON) +ifeq ($(xpath2_engine),saxon) ifeq ($(OS),Windows_NT) - SAXON_C_DIR=/cygdrive/c/Progra~1/Saxonica/SaxonHEC1.2.1 + saxon_c_dir = /cygdrive/c/Progra~1/Saxonica/SaxonHEC1.2.1 else - SAXON_C_DIR=/usr/lib + saxon_c_dir = /usr/lib endif - SAXON_C_API=saxon/Saxon.C.API + saxon_c_api = saxon/Saxon.C.API - SAXON_OBJECTS+=saxon/saxon.o - SAXON_OBJECTS+=saxon/SaxonCGlue.o - SAXON_OBJECTS+=saxon/SaxonCXPath.o - SAXON_OBJECTS+=saxon/SaxonProcessor.o - SAXON_OBJECTS+=saxon/SchemaValidator.o - SAXON_OBJECTS+=saxon/XdmAtomicValue.o - SAXON_OBJECTS+=saxon/XdmItem.o - SAXON_OBJECTS+=saxon/XdmNode.o - SAXON_OBJECTS+=saxon/XdmValue.o - SAXON_OBJECTS+=saxon/XPathProcessor.o - SAXON_OBJECTS+=saxon/XQueryProcessor.o - SAXON_OBJECTS+=saxon/Xslt30Processor.o - SAXON_OBJECTS+=saxon/XsltProcessor.o + saxon_objects += saxon/saxon.o + saxon_objects += saxon/SaxonCGlue.o + saxon_objects += saxon/SaxonCXPath.o + saxon_objects += saxon/SaxonProcessor.o + saxon_objects += saxon/SchemaValidator.o + saxon_objects += saxon/XdmAtomicValue.o + saxon_objects += saxon/XdmItem.o + saxon_objects += saxon/XdmNode.o + saxon_objects += saxon/XdmValue.o + saxon_objects += saxon/XPathProcessor.o + saxon_objects += saxon/XQueryProcessor.o + saxon_objects += saxon/Xslt30Processor.o + saxon_objects += saxon/XsltProcessor.o - SOURCE+=$(SAXON_OBJECTS) - LDFLAGS+=-lstdc++ -L$(SAXON_C_DIR) -lsaxonhec + sources += $(saxon_objects) + LDFLAGS += -lstdc++ -L$(saxon_c_dir) -lsaxonhec - SAXON_CFLAGS+=`pkg-config --cflags libxml-2.0` + saxon_cflags += `pkg-config --cflags libxml-2.0` ifneq ($(OSTYPE),msys) - LDFLAGS+=-ldl + LDFLAGS += -ldl endif # Treat MinGW/Cygwin as Linux when compiling Saxon/C API ifeq ($(OSTYPE),msys) - SAXON_CFLAGS+=-D__linux__ + saxon_cflags += -D__linux__ endif ifeq ($(OSTYPE),cygwin) - SAXON_CFLAGS+=-D__linux__ + saxon_cflags += -D__linux__ endif - ifeq ($(DEBUG),1) - SAXON_CFLAGS+=-g -DDEBUG + ifeq ($(debug),1) + saxon_cflags += -g -DDEBUG else - SAXON_CFLAGS+=-O3 + saxon_cflags += -O3 endif endif -ifeq ($(XPATH2_ENGINE),XQILLA) - XQILLA_OBJECTS+=xqilla/xqilla.o +ifeq ($(xpath2_engine),xqilla) + xqilla_objects += xqilla/xqilla.o - SOURCE+=$(XQILLA_OBJECTS) - LDFLAGS+=-lstdc++ `pkg-config --libs xerces-c` -lxqilla + sources += $(xqilla_objects) + LDFLAGS += -lstdc++ `pkg-config --libs xerces-c` -lxqilla - XQILLA_CFLAGS+=`pkg-config --cflags libxml-2.0 xerces-c` + xqilla_cflags += `pkg-config --cflags libxml-2.0 xerces-c` - ifeq ($(DEBUG),1) - XQILLA_CFLAGS+=-g -DDEBUG + ifeq ($(debug),1) + xqilla_cflags += -g -DDEBUG else - XQILLA_CFLAGS+=-O3 + xqilla_cflags += -O3 endif endif -CFLAGS+=-DXPATH2_ENGINE=$(XPATH2_ENGINE) +CFLAGS += -DXPATH2_ENGINE=$(xpath2_engine) -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) brex.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) brex.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) -saxon/%.o: $(SAXON_C_API)/%.cpp - $(CXX) $(SAXON_CFLAGS) -c -o $@ $+ +saxon/%.o: $(saxon_c_api)/%.cpp + $(CXX) $(saxon_cflags) -c -o $@ $+ -saxon/SaxonC%.o: $(SAXON_C_API)/SaxonC%.c - $(CC) $(SAXON_CFLAGS) -c -o $@ $+ +saxon/SaxonC%.o: $(saxon_c_api)/SaxonC%.c + $(CC) $(saxon_cflags) -c -o $@ $+ saxon/saxon.o: saxon/saxon.cpp - $(CXX) $(SAXON_CFLAGS) -c -I$(SAXON_C_API) -o $@ $+ + $(CXX) $(saxon_cflags) -c -I$(saxon_c_api) -o $@ $+ xqilla/xqilla.o: xqilla/xqilla.cpp - $(CXX) -c $(XQILLA_CFLAGS) -o $@ $+ + $(CXX) -c $(xqilla_cflags) -o $@ $+ brex.h: brex/DMC-*.XML stats.xsl > $@ && for f in $+; do xxd -i "$$f" >> $@; done @@ -119,15 +122,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) brex.h $(SAXON_OBJECTS) $(XQILLA_OBJECTS) + $(RM) $(executable) brex.h $(saxon_objects) $(xqilla_objects) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-brexcheck/doc/Makefile b/tools/s1kd-brexcheck/doc/Makefile index 3685f6f0..091e22dc 100644 --- a/tools/s1kd-brexcheck/doc/Makefile +++ b/tools/s1kd-brexcheck/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-04-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-brexcheck.1 -README=../README.md +source = DMC-S1KDTOOLS-A-04-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-brexcheck.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-defaults/Makefile b/tools/s1kd-defaults/Makefile index 9fa7e6a5..d4db7379 100644 --- a/tools/s1kd-defaults/Makefile +++ b/tools/s1kd-defaults/Makefile @@ -1,58 +1,61 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-defaults.c $(COMMON)/s1kd_tools.c +sources = s1kd-defaults.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-defaults.exe + executable = s1kd-defaults.exe else - OUTPUT=s1kd-defaults + executable = s1kd-defaults endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS=$(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt libexslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt libexslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) xsl.h defaults.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) xsl.h defaults.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) defaults.h: defaults.xml xxd -i $+ > $@ -xsl.h: xsl/* $(COMMON)/brexmap.xml +xsl.h: xsl/* $(common_dir)/brexmap.xml > $@ && for f in $+; do xxd -i "$$f" >> $@; done docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) xsl.h defaults.h + $(RM) $(executable) xsl.h defaults.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-defaults/doc/Makefile b/tools/s1kd-defaults/doc/Makefile index b95585c3..7c2ddf9e 100644 --- a/tools/s1kd-defaults/doc/Makefile +++ b/tools/s1kd-defaults/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-30-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-defaults.1 -README=../README.md +source = DMC-S1KDTOOLS-A-30-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-defaults.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) + +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ $(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-dmrl/Makefile b/tools/s1kd-dmrl/Makefile index 88cd1686..6970a183 100644 --- a/tools/s1kd-dmrl/Makefile +++ b/tools/s1kd-dmrl/Makefile @@ -1,38 +1,41 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-dmrl.c $(COMMON)/s1kd_tools.c +sources = s1kd-dmrl.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-dmrl.exe + executable = s1kd-dmrl.exe else - OUTPUT=s1kd-dmrl + executable = s1kd-dmrl endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) dmrl.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) dmrl.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) dmrl.h: dmrl.xsl xxd -i $+ > $@ @@ -41,15 +44,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) dmrl.h + $(RM) $(executable) dmrl.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-dmrl/doc/Makefile b/tools/s1kd-dmrl/doc/Makefile index f6acce7f..5c6a9269 100644 --- a/tools/s1kd-dmrl/doc/Makefile +++ b/tools/s1kd-dmrl/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-22-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-dmrl.1 -README=../README.md +source = DMC-S1KDTOOLS-A-22-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-dmrl.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-flatten/Makefile b/tools/s1kd-flatten/Makefile index 2f630192..e1281933 100644 --- a/tools/s1kd-flatten/Makefile +++ b/tools/s1kd-flatten/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-flatten.c $(COMMON)/s1kd_tools.c +sources = s1kd-flatten.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-flatten.exe + executable = s1kd-flatten.exe else - OUTPUT=s1kd-flatten + executable = s1kd-flatten endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) xsl.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) xsl.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) -xsl.h: xsl/remdups1.xsl xsl/remdups2.xsl $(COMMON)/remove-empty-pmentries.xsl +xsl.h: xsl/remdups1.xsl xsl/remdups2.xsl $(common_dir)/remove-empty-pmentries.xsl > $@ && for f in $+; do xxd -i "$$f" >> $@; done docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) xsl.h + $(RM) $(executable) xsl.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-flatten/doc/Makefile b/tools/s1kd-flatten/doc/Makefile index 62099bcd..d8d1529e 100644 --- a/tools/s1kd-flatten/doc/Makefile +++ b/tools/s1kd-flatten/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-23-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-flatten.1 -README=../README.md +source = DMC-S1KDTOOLS-A-23-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-flatten.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-fmgen/Makefile b/tools/s1kd-fmgen/Makefile index 9d653e37..14cebe5f 100644 --- a/tools/s1kd-fmgen/Makefile +++ b/tools/s1kd-fmgen/Makefile @@ -1,38 +1,41 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-fmgen.c $(COMMON)/s1kd_tools.c +sources = s1kd-fmgen.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-fmgen.exe + executable = s1kd-fmgen.exe else - OUTPUT=s1kd-fmgen + executable = s1kd-fmgen endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) xsl.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) xsl.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) xsl.h: fmtypes.xml fmtypes.txt xsl/* > $@ && for f in $+; do xxd -i "$$f" >> $@; done @@ -41,15 +44,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) xsl.h + $(RM) $(executable) xsl.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-fmgen/doc/Makefile b/tools/s1kd-fmgen/doc/Makefile index 978e106b..8397e962 100644 --- a/tools/s1kd-fmgen/doc/Makefile +++ b/tools/s1kd-fmgen/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-33-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-fmgen.1 -README=../README.md +source = DMC-S1KDTOOLS-A-33-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-fmgen.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-icncatalog/Makefile b/tools/s1kd-icncatalog/Makefile index e137d072..033c8ffc 100644 --- a/tools/s1kd-icncatalog/Makefile +++ b/tools/s1kd-icncatalog/Makefile @@ -1,42 +1,45 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-icncatalog.c $(COMMON)/s1kd_tools.c +sources = s1kd-icncatalog.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-icncatalog.exe + executable = s1kd-icncatalog.exe else - OUTPUT=s1kd-icncatalog + executable = s1kd-icncatalog endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` ifneq ($(MSYSTEM),) - LDFLAGS+=`pkg-config --libs regex` + LDFLAGS += `pkg-config --libs regex` endif -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin + +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) templates.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) templates.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) templates.h: icncatalog.xml xxd -i $+ > $@ @@ -45,15 +48,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) templates.h + $(RM) $(executable) templates.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-icncatalog/doc/Makefile b/tools/s1kd-icncatalog/doc/Makefile index 538819da..d1f929f0 100644 --- a/tools/s1kd-icncatalog/doc/Makefile +++ b/tools/s1kd-icncatalog/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-32-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-icncatalog.1 -README=../README.md +source = DMC-S1KDTOOLS-A-32-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-icncatalog.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-index/Makefile b/tools/s1kd-index/Makefile index d5dcbfa1..b1e2af96 100644 --- a/tools/s1kd-index/Makefile +++ b/tools/s1kd-index/Makefile @@ -1,38 +1,41 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-index.c $(COMMON)/s1kd_tools.c +sources = s1kd-index.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-index.exe + executable = s1kd-index.exe else - OUTPUT=s1kd-index + executable = s1kd-index endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) xslt.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) xslt.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) xslt.h: iss30.xsl delete.xsl > $@ && for f in $+; do xxd -i "$$f" >> $@; done @@ -41,15 +44,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) xslt.h + $(RM) $(executable) xslt.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-index/doc/Makefile b/tools/s1kd-index/doc/Makefile index 3471986f..5db44cae 100644 --- a/tools/s1kd-index/doc/Makefile +++ b/tools/s1kd-index/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-28-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-index.1 -README=../README.md +source = DMC-S1KDTOOLS-A-28-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-index.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-instance/Makefile b/tools/s1kd-instance/Makefile index a3008f46..c1576286 100644 --- a/tools/s1kd-instance/Makefile +++ b/tools/s1kd-instance/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-instance.c $(COMMON)/s1kd_tools.c +sources = s1kd-instance.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-instance.exe + executable = s1kd-instance.exe else - OUTPUT=s1kd-instance + executable = s1kd-instance endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt libexslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt libexslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt libexslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt libexslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -xsl.h: $(COMMON)/remove-empty-pmentries.xsl xsl/*.xsl cirxsl/*.xsl +xsl.h: $(common_dir)/remove-empty-pmentries.xsl xsl/*.xsl cirxsl/*.xsl > $@ && for f in $+; do xxd -i "$$f" >> $@; done -$(OUTPUT): $(SOURCE) xsl.h - $(CC) $(CFLAGS) $(SOURCE) -o $(OUTPUT) $(LDFLAGS) +$(executable): $(sources) xsl.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) xsl.h + $(RM) $(executable) xsl.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-instance/doc/Makefile b/tools/s1kd-instance/doc/Makefile index a1e758c5..9884bb31 100644 --- a/tools/s1kd-instance/doc/Makefile +++ b/tools/s1kd-instance/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-03-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-instance.1 -README=../README.md +source = DMC-S1KDTOOLS-A-03-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-instance.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-ls/Makefile b/tools/s1kd-ls/Makefile index e32a4491..53ffd75c 100644 --- a/tools/s1kd-ls/Makefile +++ b/tools/s1kd-ls/Makefile @@ -1,52 +1,55 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-ls.c $(COMMON)/s1kd_tools.c +sources = s1kd-ls.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-ls.exe + executable = s1kd-ls.exe else - OUTPUT=s1kd-ls + executable = s1kd-ls endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-ls/doc/Makefile b/tools/s1kd-ls/doc/Makefile index 87e5170c..4b04215b 100644 --- a/tools/s1kd-ls/doc/Makefile +++ b/tools/s1kd-ls/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-06-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-ls.1 -README=../README.md +source = DMC-S1KDTOOLS-A-06-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-ls.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-metadata/Makefile b/tools/s1kd-metadata/Makefile index 06a2b1a3..91b8d35f 100644 --- a/tools/s1kd-metadata/Makefile +++ b/tools/s1kd-metadata/Makefile @@ -1,56 +1,59 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-metadata.c $(COMMON)/s1kd_tools.c +sources = s1kd-metadata.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-metadata.exe + executable = s1kd-metadata.exe else - OUTPUT=s1kd-metadata + executable = s1kd-metadata endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` ifneq ($(MSYSTEM),) - LDFLAGS+=`pkg-config --libs regex` + LDFLAGS += `pkg-config --libs regex` endif -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin + +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(SOURCE) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-metadata/doc/Makefile b/tools/s1kd-metadata/doc/Makefile index fb66d99e..194ee897 100644 --- a/tools/s1kd-metadata/doc/Makefile +++ b/tools/s1kd-metadata/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-09-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-metadata.1 -README=../README.md +source = DMC-S1KDTOOLS-A-09-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-metadata.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-mvref/Makefile b/tools/s1kd-mvref/Makefile index 0a6c1865..ce81cf65 100644 --- a/tools/s1kd-mvref/Makefile +++ b/tools/s1kd-mvref/Makefile @@ -1,52 +1,55 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-mvref.c $(COMMON)/s1kd_tools.c +sources = s1kd-mvref.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-mvref.exe + executable = s1kd-mvref.exe else - OUTPUT=s1kd-mvref + executable = s1kd-mvref endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-mvref/doc/Makefile b/tools/s1kd-mvref/doc/Makefile index eedd2ef0..bd45bbee 100644 --- a/tools/s1kd-mvref/doc/Makefile +++ b/tools/s1kd-mvref/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-19-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-mvref.1 -README=../README.md +source = DMC-S1KDTOOLS-A-19-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-mvref.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-neutralize/Makefile b/tools/s1kd-neutralize/Makefile index c358f76b..c9057748 100644 --- a/tools/s1kd-neutralize/Makefile +++ b/tools/s1kd-neutralize/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-neutralize.c $(COMMON)/s1kd_tools.c +sources = s1kd-neutralize.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-neutralize.exe + executable = s1kd-neutralize.exe else - OUTPUT=s1kd-neutralize + executable = s1kd-neutralize endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) stylesheets.h: stylesheets/*.xsl > $@ && for f in $+; do xxd -i "$$f" >> $@; done -$(OUTPUT): $(SOURCE) stylesheets.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) stylesheets.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) stylesheets.h + $(RM) $(executable) stylesheets.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-neutralize/doc/Makefile b/tools/s1kd-neutralize/doc/Makefile index 780693eb..98fe7119 100644 --- a/tools/s1kd-neutralize/doc/Makefile +++ b/tools/s1kd-neutralize/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-14-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-neutralize.1 -README=../README.md +source = DMC-S1KDTOOLS-A-14-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-neutralize.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-newcom/Makefile b/tools/s1kd-newcom/Makefile index 85a3cf80..c124420d 100644 --- a/tools/s1kd-newcom/Makefile +++ b/tools/s1kd-newcom/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-newcom.c $(COMMON)/s1kd_tools.c +sources = s1kd-newcom.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-newcom.exe + executable = s1kd-newcom.exe else - OUTPUT=s1kd-newcom + executable = s1kd-newcom endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) template.h: comment.xml $(COMMON)/to*.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done -$(OUTPUT): $(SOURCE) template.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) template.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) template.h + $(RM) $(executable) template.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-newcom/doc/Makefile b/tools/s1kd-newcom/doc/Makefile index 36435ad8..2e225fc0 100644 --- a/tools/s1kd-newcom/doc/Makefile +++ b/tools/s1kd-newcom/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-16-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-newcom.1 -README=../README.md +source = DMC-S1KDTOOLS-A-16-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-newcom.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-newddn/Makefile b/tools/s1kd-newddn/Makefile index 6b9c1e58..ce64fb89 100644 --- a/tools/s1kd-newddn/Makefile +++ b/tools/s1kd-newddn/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-newddn.c $(COMMON)/s1kd_tools.c +sources = s1kd-newddn.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-newddn.exe + executable = s1kd-newddn.exe else - OUTPUT=s1kd-newddn + executable = s1kd-newddn endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -templates.h: templates/ddn.xml $(COMMON)/to*.xsl +templates.h: templates/ddn.xml $(common_dir)/to*.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done -$(OUTPUT): $(SOURCE) templates.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) templates.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) templates.h + $(RM) $(executable) templates.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-newddn/doc/Makefile b/tools/s1kd-newddn/doc/Makefile index 3d2404f9..9b90e859 100644 --- a/tools/s1kd-newddn/doc/Makefile +++ b/tools/s1kd-newddn/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-17-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-newddn.1 -README=../README.md +source = DMC-S1KDTOOLS-A-17-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-newddn.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-newdm/Makefile b/tools/s1kd-newdm/Makefile index 3e254d14..81a454be 100644 --- a/tools/s1kd-newdm/Makefile +++ b/tools/s1kd-newdm/Makefile @@ -1,37 +1,40 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-newdm.c $(COMMON)/s1kd_tools.c +sources = s1kd-newdm.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-newdm.exe + executable = s1kd-newdm.exe else - OUTPUT=s1kd-newdm + executable = s1kd-newdm endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -templates.h: templates/*.xml $(COMMON)/to*.xsl $(COMMON)/brexmap.xml +templates.h: templates/*.xml $(common_dir)/to*.xsl $(common_dir)/brexmap.xml > $@ && for f in $+; do xxd -i $$f >> $@; done dmtypes.h: dmtypes.xml dmtypes.txt @@ -40,22 +43,22 @@ dmtypes.h: dmtypes.xml dmtypes.txt sns.h: sns/*.XML > $@ && for f in $+; do xxd -i $$f >> $@; done -$(OUTPUT): $(SOURCE) templates.h dmtypes.h sns.h - $(CC) $(CFLAGS) $(SOURCE) -o $(OUTPUT) $(LDFLAGS) +$(executable): $(sources) templates.h dmtypes.h sns.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) templates.h dmtypes.h sns.h + $(RM) $(executable) templates.h dmtypes.h sns.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-newdm/doc/Makefile b/tools/s1kd-newdm/doc/Makefile index 4ab13b36..3342d540 100644 --- a/tools/s1kd-newdm/doc/Makefile +++ b/tools/s1kd-newdm/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-07-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-newdm.1 -README=../README.md +source = DMC-S1KDTOOLS-A-07-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-newdm.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-newdml/Makefile b/tools/s1kd-newdml/Makefile index 91927e12..3e802c5c 100644 --- a/tools/s1kd-newdml/Makefile +++ b/tools/s1kd-newdml/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-newdml.c $(COMMON)/s1kd_tools.c +sources = s1kd-newdml.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-newdml.exe + executable = s1kd-newdml.exe else - OUTPUT=s1kd-newdml + executable = s1kd-newdml endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) templates.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) templates.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) -templates.h: dml.xml $(COMMON)/to*.xsl sns2dmrl.xsl sort.xsl +templates.h: dml.xml $(common_dir)/to*.xsl sns2dmrl.xsl sort.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) templates.h + $(RM) $(executable) templates.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-newdml/doc/Makefile b/tools/s1kd-newdml/doc/Makefile index a126d98a..436dca3d 100644 --- a/tools/s1kd-newdml/doc/Makefile +++ b/tools/s1kd-newdml/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-21-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-newdml.1 -README=../README.md +source = DMC-S1KDTOOLS-A-21-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-newdml.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-newimf/Makefile b/tools/s1kd-newimf/Makefile index 7acf2a18..970d00c7 100644 --- a/tools/s1kd-newimf/Makefile +++ b/tools/s1kd-newimf/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-newimf.c $(COMMON)/s1kd_tools.c +sources = s1kd-newimf.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-newimf.exe + executable = s1kd-newimf.exe else - OUTPUT=s1kd-newimf + executable = s1kd-newimf endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -template.h: icnmetadata.xml $(COMMON)/to42.xsl +template.h: icnmetadata.xml $(common_dir)/to42.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done -$(OUTPUT): $(SOURCE) template.h - $(CC) $(CFLAGS) $(SOURCE) -o $(OUTPUT) $(LDFLAGS) +$(executable): $(sources) template.h + $(CC) $(CFLAGS) -o $@ $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) template.h + $(RM) $(executable) template.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-newimf/doc/Makefile b/tools/s1kd-newimf/doc/Makefile index 4c06dccb..f4c2ac4a 100644 --- a/tools/s1kd-newimf/doc/Makefile +++ b/tools/s1kd-newimf/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-13-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-newimf.1 -README=../README.md +source = DMC-S1KDTOOLS-A-13-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-newimf.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-newpm/Makefile b/tools/s1kd-newpm/Makefile index 55887117..3f3ad5c7 100644 --- a/tools/s1kd-newpm/Makefile +++ b/tools/s1kd-newpm/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-newpm.c $(COMMON)/s1kd_tools.c +sources = s1kd-newpm.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-newpm.exe + executable = s1kd-newpm.exe else - OUTPUT=s1kd-newpm + executable = s1kd-newpm endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -template.h: pm.xml $(COMMON)/to*.xsl +template.h: pm.xml $(common_dir)/to*.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done -$(OUTPUT): $(SOURCE) template.h - $(CC) $(CFLAGS) $(SOURCE) -o $(OUTPUT) $(LDFLAGS) +$(executable): $(sources) template.h + $(CC) $(CFLAGS) -o $@ $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) template.h + $(RM) $(executable) template.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-newpm/doc/Makefile b/tools/s1kd-newpm/doc/Makefile index d72c9acf..1c85e8d5 100644 --- a/tools/s1kd-newpm/doc/Makefile +++ b/tools/s1kd-newpm/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-12-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-newpm.1 -README=../README.md +source = DMC-S1KDTOOLS-A-12-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-newpm.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-newsmc/Makefile b/tools/s1kd-newsmc/Makefile index 6d9983bd..d46bcb2b 100644 --- a/tools/s1kd-newsmc/Makefile +++ b/tools/s1kd-newsmc/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-newsmc.c $(COMMON)/s1kd_tools.c +sources = s1kd-newsmc.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-newsmc.exe + executable = s1kd-newsmc.exe else - OUTPUT=s1kd-newsmc + executable = s1kd-newsmc endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -template.h: scormcontentpackage.xml $(COMMON)/to41.xsl $(COMMON)/to42.xsl +template.h: scormcontentpackage.xml $(common_dir)/to41.xsl $(common_dir)/to42.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done -$(OUTPUT): $(SOURCE) template.h - $(CC) $(CFLAGS) $(SOURCE) -o $(OUTPUT) $(LDFLAGS) +$(executable): $(sources) template.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) template.h + $(RM) $(executable) template.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-newsmc/doc/Makefile b/tools/s1kd-newsmc/doc/Makefile index 04c9c70e..ed03ed8f 100644 --- a/tools/s1kd-newsmc/doc/Makefile +++ b/tools/s1kd-newsmc/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-35-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-newsmc.1 -README=../README.md +source = DMC-S1KDTOOLS-A-35-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-newsmc.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-newupf/Makefile b/tools/s1kd-newupf/Makefile index 98dbaba0..26f46ee6 100644 --- a/tools/s1kd-newupf/Makefile +++ b/tools/s1kd-newupf/Makefile @@ -1,55 +1,58 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-newupf.c $(COMMON)/s1kd_tools.c +sources = s1kd-newupf.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-newupf.exe + executable = s1kd-newupf.exe else - OUTPUT=s1kd-newupf + executable = s1kd-newupf endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -templates.h: update.xml $(COMMON)/to41.xsl $(COMMON)/to42.xsl +templates.h: update.xml $(common_dir)/to41.xsl $(common_dir)/to42.xsl > $@ && for f in $+; do xxd -i $$f >> $@; done -$(OUTPUT): $(SOURCE) templates.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) templates.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) templates.h + $(RM) $(executable) templates.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-newupf/doc/Makefile b/tools/s1kd-newupf/doc/Makefile index b6e47b98..a5191eaf 100644 --- a/tools/s1kd-newupf/doc/Makefile +++ b/tools/s1kd-newupf/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-31-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-newupf.1 -README=../README.md +source = DMC-S1KDTOOLS-A-31-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-newupf.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-ref/Makefile b/tools/s1kd-ref/Makefile index c83591b8..6d97e7c0 100644 --- a/tools/s1kd-ref/Makefile +++ b/tools/s1kd-ref/Makefile @@ -1,44 +1,47 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-ref.c $(COMMON)/s1kd_tools.c +sources = s1kd-ref.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-ref.exe + executable = s1kd-ref.exe else - OUTPUT=s1kd-ref + executable = s1kd-ref endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - LDFLAGS+=`pkg-config --libs regex` + LDFLAGS += `pkg-config --libs regex` endif -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin + +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) xslt.h elems.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) xslt.h elems.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) -xslt.h: $(COMMON)/to*.xsl ref.xsl +xslt.h: $(common_dir)/to*.xsl ref.xsl > $@ && for f in $+; do xxd -i "$$f" >> $@; done elems.h: elems/*.txt @@ -48,15 +51,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) xslt.h elems.h + $(RM) $(executable) xslt.h elems.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-ref/doc/Makefile b/tools/s1kd-ref/doc/Makefile index 5642f9d1..c1a17026 100644 --- a/tools/s1kd-ref/doc/Makefile +++ b/tools/s1kd-ref/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-08-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-ref.1 -README=../README.md +source = DMC-S1KDTOOLS-A-08-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-ref.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-refs/Makefile b/tools/s1kd-refs/Makefile index 042a04b0..938533a9 100644 --- a/tools/s1kd-refs/Makefile +++ b/tools/s1kd-refs/Makefile @@ -1,52 +1,55 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-refs.c $(COMMON)/s1kd_tools.c +sources = s1kd-refs.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-refs.exe + executable = s1kd-refs.exe else - OUTPUT=s1kd-refs + executable = s1kd-refs endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS=$(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-refs/doc/Makefile b/tools/s1kd-refs/doc/Makefile index ae6869ca..9b24c316 100644 --- a/tools/s1kd-refs/doc/Makefile +++ b/tools/s1kd-refs/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-25-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-refs.1 -README=../README.md +source = DMC-S1KDTOOLS-A-25-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-refs.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-repcheck/Makefile b/tools/s1kd-repcheck/Makefile index 9d3e3a48..2a5ce800 100644 --- a/tools/s1kd-repcheck/Makefile +++ b/tools/s1kd-repcheck/Makefile @@ -1,38 +1,41 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-repcheck.c $(COMMON)/s1kd_tools.c +sources = s1kd-repcheck.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-repcheck.exe + executable = s1kd-repcheck.exe else - OUTPUT=s1kd-repcheck + executable = s1kd-repcheck endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) xsl.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) xsl.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) xsl.h: xsl/cirrefs.xsl xsl/cirrefsall.xsl xsl/stats.xsl > $@ && for f in $+; do xxd -i "$$f" >> $@; done @@ -41,15 +44,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) xsl.h + $(RM) $(executable) xsl.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-repcheck/doc/Makefile b/tools/s1kd-repcheck/doc/Makefile index d7218f0c..bf1ca2dc 100644 --- a/tools/s1kd-repcheck/doc/Makefile +++ b/tools/s1kd-repcheck/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-18-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-repcheck.1 -README=../README.md +source = DMC-S1KDTOOLS-A-18-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-repcheck.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-sns/Makefile b/tools/s1kd-sns/Makefile index 3d8b1d15..d15e2dbd 100644 --- a/tools/s1kd-sns/Makefile +++ b/tools/s1kd-sns/Makefile @@ -1,52 +1,55 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-sns.c $(COMMON)/s1kd_tools.c +sources = s1kd-sns.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-sns.exe + executable = s1kd-sns.exe else - OUTPUT=s1kd-sns + executable = s1kd-sns endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS=$(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-sns/doc/Makefile b/tools/s1kd-sns/doc/Makefile index 1277f2cc..e986f1ad 100644 --- a/tools/s1kd-sns/doc/Makefile +++ b/tools/s1kd-sns/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-34-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-sns.1 -README=../README.md +source = DMC-S1KDTOOLS-A-34-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-sns.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-syncrefs/Makefile b/tools/s1kd-syncrefs/Makefile index 9cb774fb..52c1e674 100644 --- a/tools/s1kd-syncrefs/Makefile +++ b/tools/s1kd-syncrefs/Makefile @@ -1,52 +1,55 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-syncrefs.c $(COMMON)/s1kd_tools.c +sources = s1kd-syncrefs.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-syncrefs.exe + executable = s1kd-syncrefs.exe else - OUTPUT=s1kd-syncrefs + executable = s1kd-syncrefs endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-syncrefs/doc/Makefile b/tools/s1kd-syncrefs/doc/Makefile index 9f7f0172..b7f67a7e 100644 --- a/tools/s1kd-syncrefs/doc/Makefile +++ b/tools/s1kd-syncrefs/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-01-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-syncrefs.1 -README=../README.md +source = DMC-S1KDTOOLS-A-01-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-syncrefs.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-uom/Makefile b/tools/s1kd-uom/Makefile index 74b252ba..fb59c16b 100644 --- a/tools/s1kd-uom/Makefile +++ b/tools/s1kd-uom/Makefile @@ -1,38 +1,41 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-uom.c $(COMMON)/s1kd_tools.c +sources = s1kd-uom.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-uom.exe + executable = s1kd-uom.exe else - OUTPUT=s1kd-uom + executable = s1kd-uom endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0 libxslt` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0 libxslt` +LDFLAGS = `pkg-config --libs libxml-2.0 libxslt` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bindir -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) uom.h - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) uom.h + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) uom.h: uom.xml uom.xsl uomdisplay.xml uomdisplay.xsl dupl.xsl undupl.xsl presets/*.xml > $@ && for f in $+; do xxd -i $$f >> $@; done @@ -41,15 +44,15 @@ docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) uom.h + $(RM) $(executable) uom.h maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-uom/doc/Makefile b/tools/s1kd-uom/doc/Makefile index 36e8594b..92e1baab 100644 --- a/tools/s1kd-uom/doc/Makefile +++ b/tools/s1kd-uom/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-10-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-uom.1 -README=../README.md +source = DMC-S1KDTOOLS-A-10-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-uom.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-upissue/Makefile b/tools/s1kd-upissue/Makefile index 2a5d40e4..c6b59f18 100644 --- a/tools/s1kd-upissue/Makefile +++ b/tools/s1kd-upissue/Makefile @@ -1,52 +1,55 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-upissue.c $(COMMON)/s1kd_tools.c +sources = s1kd-upissue.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-upissue.exe + executable = s1kd-upissue.exe else - OUTPUT=s1kd-upissue + executable = s1kd-upissue endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-upissue/doc/Makefile b/tools/s1kd-upissue/doc/Makefile index ddaba8a2..aa430e6b 100644 --- a/tools/s1kd-upissue/doc/Makefile +++ b/tools/s1kd-upissue/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-05-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-upissue.1 -README=../README.md +source = DMC-S1KDTOOLS-A-05-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-upissue.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage) diff --git a/tools/s1kd-validate/Makefile b/tools/s1kd-validate/Makefile index fe57d858..453a4d76 100644 --- a/tools/s1kd-validate/Makefile +++ b/tools/s1kd-validate/Makefile @@ -1,52 +1,55 @@ .PHONY: docs clean maintainer-clean install uninstall -COMMON=../common +common_dir = ../common -SOURCE=s1kd-validate.c $(COMMON)/s1kd_tools.c +sources = s1kd-validate.c $(common_dir)/s1kd_tools.c ifeq ($(OS),Windows_NT) - OUTPUT=s1kd-validate.exe + executable = s1kd-validate.exe else - OUTPUT=s1kd-validate + executable = s1kd-validate endif -WARNING_FLAGS=-Wall -Werror -pedantic-errors -CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0` +warning_flags = -Wall -Werror -pedantic-errors + +CFLAGS = $(warning_flags) -I $(common_dir) `pkg-config --cflags libxml-2.0` ifneq ($(MSYSTEM),) - CFLAGS+=-isystem $(COMMON)/msys + CFLAGS += -isystem $(common_dir)/msys endif -ifeq ($(DEBUG),1) - CFLAGS+=-g +ifeq ($(debug),1) + CFLAGS += -g else - CFLAGS+=-O3 + CFLAGS += -O3 endif -LDFLAGS=`pkg-config --libs libxml-2.0` +LDFLAGS = `pkg-config --libs libxml-2.0` + +prefix = /usr/local +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin -PREFIX=/usr/local -INSTALL_PREFIX=$(PREFIX)/bin -INSTALL=install -Ds +INSTALL = install -Ds -all: $(OUTPUT) +all: $(executable) -$(OUTPUT): $(SOURCE) - $(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS) +$(executable): $(sources) + $(CC) $(CFLAGS) -o $(executable) $(sources) $(LDFLAGS) docs: $(MAKE) -C doc clean: - rm -f $(OUTPUT) + $(RM) $(executable) maintainer-clean: clean $(MAKE) -C doc clean -install: $(OUTPUT) - $(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT) +install: $(executable) + $(INSTALL) $(executable) $(bindir)/$(executable) $(MAKE) -C doc install uninstall: - rm -f $(INSTALL_PREFIX)/$(OUTPUT) + $(RM) $(bindir)/$(executable) $(MAKE) -C doc uninstall diff --git a/tools/s1kd-validate/doc/Makefile b/tools/s1kd-validate/doc/Makefile index 52417e6c..30db95e4 100644 --- a/tools/s1kd-validate/doc/Makefile +++ b/tools/s1kd-validate/doc/Makefile @@ -1,26 +1,29 @@ -SOURCE=DMC-S1KDTOOLS-A-02-00-00-00A-040A-D_EN-CA.XML -OUTPUT=s1kd-validate.1 -README=../README.md +source = DMC-S1KDTOOLS-A-02-00-00-00A-040A-D_EN-CA.XML +manpage = s1kd-validate.1 +readme = ../README.md -PREFIX=/usr/local -MAN_PREFIX=$(PREFIX)/share/man/man1 -INSTALL=install -D +prefix = /usr/local +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 -all: $(OUTPUT) $(README) +INSTALL = install -D -$(README): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t gfm -s -o $(README) +all: $(manpage) $(readme) -$(OUTPUT): $(SOURCE) - s1kd2db $(SOURCE) | pandoc -f docbook -t man -s -o $(OUTPUT) +$(readme): $(source) + s1kd2db $^ | pandoc -f docbook -t gfm -s -o $@ + +$(manpage): $(source) + s1kd2db $^ | pandoc -f docbook -t man -s -o $@ .PHONY: clean install uninstall clean: - rm -f $(OUTPUT) $(README) + $(RM) $(manpage) $(readme) -install: - $(INSTALL) $(OUTPUT) $(MAN_PREFIX)/$(OUTPUT) +install: $(manpage) + $(INSTALL) $(manpage) $(man1dir)/$(manpage) uninstall: - rm -f $(MAN_PREFIX)/$(OUTPUT) + $(RM) $(man1dir)/$(manpage)