..
/
download
.PHONY: docs clean maintainer-clean install uninstall
COMMON=../common
SOURCE=s1kd-icncatalog.c $(COMMON)/s1kd_tools.c
ifeq ($(OS),Windows_NT)
OUTPUT=s1kd-icncatalog.exe
else
OUTPUT=s1kd-icncatalog
endif
WARNING_FLAGS=-Wall -Werror -pedantic-errors
CFLAGS=$(WARNING_FLAGS) -I $(COMMON) `pkg-config --cflags libxml-2.0`
ifeq ($(MSYSTEM),MINGW64)
CFLAGS+=-isystem $(COMMON)/mingw64
endif
ifeq ($(DEBUG),1)
CFLAGS+=-g
else
CFLAGS+=-O3
endif
LDFLAGS=`pkg-config --libs libxml-2.0`
ifeq ($(MSYSTEM),MINGW32)
LDFLAGS+=-lregex2
else ifeq ($(MSYSTEM),MINGW64)
LDFLAGS+=`pkg-config --libs regex`
endif
PREFIX=/usr/local
INSTALL_PREFIX=$(PREFIX)/bin
INSTALL=install -Ds
all: $(OUTPUT)
$(OUTPUT): $(SOURCE) templates.h
$(CC) $(CFLAGS) -o $(OUTPUT) $(SOURCE) $(LDFLAGS)
templates.h: icncatalog.xml
xxd -i $+ > $@
docs:
$(MAKE) -C doc
clean:
rm -f $(OUTPUT) templates.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/s1kd/s1kd-tools/src/tools/s1kd-icncatalog/Makefile