/ .. / / -> download
.PHONY: docs clean maintainer-clean install uninstall

COMMON=../common

SOURCE=xml-transform.c $(COMMON)/xml-utils.c

ifeq ($(OS),Windows_NT)
  OUTPUT=xml-transform.exe
else
  OUTPUT=xml-transform
endif

WARNING_FLAGS=-Wall -Werror -pedantic-errors
CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0 libxslt libexslt`

ifeq ($(DEBUG),1)
  CFLAGS+=-g
else
  CFLAGS+=-O3
endif

LDFLAGS=`pkg-config --libs libxml-2.0 libxslt libexslt`

PREFIX=/usr/local
INSTALL_PREFIX=$(PREFIX)/bin
INSTALL=install -Ds

all: $(OUTPUT)

identity.h: identity.xsl
	xxd -i $< > $@

$(OUTPUT): $(SOURCE) identity.h
	$(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS)

docs:
	$(MAKE) -C doc

clean:
	rm -f $(OUTPUT) identity.h

maintainer-clean: clean
	$(MAKE) -C doc clean

install: $(OUTPUT)
	$(INSTALL) $(OUTPUT) $(INSTALL_PREFIX)/$(OUTPUT)
	$(MAKE) -C doc install

uninstall:
	rm -f $(INSTALL_PREFIX)/$(OUTPUT)
	$(MAKE) -C doc uninstall


/ gopher://khzae.net/0/s1000d/xml/xml-utils/src/utils/xml-transform/Makefile
Styles: Light Dark Classic