Skip to content

Commit

Permalink
Update makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
kibook committed Apr 4, 2024
1 parent e0d83aa commit fbca52c
Show file tree
Hide file tree
Showing 66 changed files with 1,412 additions and 1,220 deletions.
18 changes: 9 additions & 9 deletions doc/DMC-S1KDTOOLS-A-00-00-00-00A-920A-D_EN-CA.XML
Original file line number Diff line number Diff line change
Expand Up @@ -254,34 +254,34 @@
<para>The following parameters can be given to <verbatimText>make</verbatimText> to control certain options when building and installing.</para>
<levelledPara>
<title>
<verbatimText>PREFIX</verbatimText>
<verbatimText>prefix</verbatimText>
</title>
<para>The <verbatimText>PREFIX</verbatimText> variable determines where the s1kd-tools are installed when running <verbatimText>make install</verbatimText>, and where they are uninstalled from when running <verbatimText>make uninstall</verbatimText>. The default value is <verbatimText>/usr/local</verbatimText>.</para>
<para>The <verbatimText>prefix</verbatimText> variable determines where the s1kd-tools are installed when running <verbatimText>make install</verbatimText>, and where they are uninstalled from when running <verbatimText>make uninstall</verbatimText>. The default value is <verbatimText>/usr/local</verbatimText>.</para>
<para>
Example:
<verbatimText verbatimStyle="vs24"># make PREFIX=/usr install</verbatimText>
<verbatimText verbatimStyle="vs24"># make PREFIX=/usr uninstall</verbatimText>
<verbatimText verbatimStyle="vs24"># make prefix=/usr install</verbatimText>
<verbatimText verbatimStyle="vs24"># make prefix=/usr uninstall</verbatimText>
</para>
</levelledPara>
<levelledPara>
<title>
<verbatimText>XPATH2_ENGINE</verbatimText>
<verbatimText>xpath2_engine</verbatimText>
</title>
<para>The <verbatimText>XPATH2_ENGINE</verbatimText> variable determines which XPath 2.0 implementation the s1kd-brexcheck tool will use to evaluate the object paths of BREX rules.</para>
<para>The <verbatimText>xpath2_engine</verbatimText> variable determines which XPath 2.0 implementation the s1kd-brexcheck tool will use to evaluate the object paths of BREX rules.</para>
<para>
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:
<definitionList>
<definitionListItem>
<listItemTerm>
<verbatimText>SAXON</verbatimText>
<verbatimText>saxon</verbatimText>
</listItemTerm>
<listItemDefinition>
<para>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.</para>
</listItemDefinition>
</definitionListItem>
<definitionListItem>
<listItemTerm>
<verbatimText>XQILLA</verbatimText>
<verbatimText>xqilla</verbatimText>
</listItemTerm>
<listItemDefinition>
<para>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.</para>
Expand All @@ -291,7 +291,7 @@
</para>
<para>
Example:
<verbatimText verbatimStyle="vs24">$ make XPATH2_ENGINE=XQILLA</verbatimText>
<verbatimText verbatimStyle="vs24">$ make xpath2_engine=xqilla</verbatimText>
</para>
</levelledPara>
</levelledPara>
Expand Down
14 changes: 7 additions & 7 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
45 changes: 24 additions & 21 deletions tools/s1kd-acronyms/Makefile
Original file line number Diff line number Diff line change
@@ -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
29 changes: 16 additions & 13 deletions tools/s1kd-acronyms/doc/Makefile
Original file line number Diff line number Diff line change
@@ -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)
45 changes: 24 additions & 21 deletions tools/s1kd-addicn/Makefile
Original file line number Diff line number Diff line change
@@ -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
33 changes: 18 additions & 15 deletions tools/s1kd-addicn/doc/Makefile
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit fbca52c

Please sign in to comment.