sanskrit-iast/Makefile.in

141 lines
3.4 KiB
Makefile

PROGNAME = @PROGNAME@
VERSION = @PACKAGE_VERSION@
VERSION_FULL = $(VERSION)
VERSION_MAJOR = $(firstword $(subst ., ,$(VERSION)))
LIBNAME = lib@PROGNAME@
ANAME = $(LIBNAME).a
LINKNAME = $(LIBNAME).so
SONAME = $(LIBNAME).so.$(VERSION_MAJOR)
REALNAME = $(LIBNAME).so.$(VERSION_FULL)
LIBFILES = $(ANAME) $(LINKNAME) $(SONAME) $(REALNAME)
CC = @CC@
AR = @AR@
LN_S = @LN_S@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
MKDIR_P = @MKDIR_P@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
datarootdir = @datarootdir@
includedir = @includedir@
pkgconfigdir = @pkgconfigdir@
mandir = @mandir@
USE_GCOV = @USE_GCOV@
CFLAGS = -Wall @CFLAGS@ @COVERAGE_CFLAGS@
LFLAGS = @COVERAGE_LFLAGS@
TEST_CFLAGS = @CFLAGS@ @CHECK_CFLAGS@
TEST_LFLAGS = @CHECK_LIBS@ @COVERAGE_LFLAGS@
OBJECTS = transliteration.o czech.o hindi.o utf8.o velthuis.o harvard-kyoto.o
INCLUDES = harvard-kyoto.h transliteration.h velthuis.h
TEST_OBJECTS = tests/main.o tests/translit.o tests/czech.o \
tests/hindi.o tests/velthuis.o tests/harvard-kyoto.o \
tests/utf8.o tests/integration.o
AUX_FILES = Makefile configure aclocal.m4 install-sh config.h* *.log \
*.status *.cache
all: $(PROGNAME) $(LIBFILES) tests/test $(PROGNAME).1.gz
include $(wildcard *.d tests/*.d)
$(PROGNAME): main.o $(ANAME)
$(QUIET_LD) $(CC) $^ -o $@ $(LFLAGS)
$(ANAME): $(OBJECTS)
$(QUIET_AR) $(AR) rcs $@ $^
$(REALNAME): $(OBJECTS)
$(QUIET_LD) $(CC) $^ -shared -o $@ $(LFLAGS)
$(SONAME): $(REALNAME)
$(QUIET_LN) $(LN_S) -f $< $@
$(LINKNAME): $(SONAME)
$(QUIET_LN) $(LN_S) -f $< $@
test: all
tests/test
%.o: %.c
$(QUIET_CC) $(CC) -MMD -MP -c $< -o $@ $(CFLAGS)
tests/%.o: tests/%.c
$(QUIET_CC) $(CC) -MMD -MP -c $< -o $@ $(TEST_CFLAGS)
tests/test: $(OBJECTS) $(TEST_OBJECTS)
$(QUIET_LD) $(CC) $^ -o $@ $(TEST_LFLAGS)
%.1.gz: %.1
$(QUIET_GEN) cat $< | gzip -f >$@
install: install-prog install-lib install-dev
install-prog:
$(MKDIR_P) $(bindir) $(libdir) $(mandir)/man1
$(INSTALL_PROGRAM) $(PROGNAME) $(bindir)
$(INSTALL_DATA) $(PROGNAME).1.gz $(mandir)/man1
install-lib:
$(MKDIR_P) $(libdir)
cp -P $(REALNAME) $(SONAME) $(libdir)
install-dev:
$(MKDIR_P) $(includedir)/iast $(libdir) $(pkgconfigdir)
$(INSTALL_DATA) $(INCLUDES) $(includedir)/iast
$(INSTALL_DATA) iast.h $(includedir)
$(INSTALL_DATA) $(PROGNAME).pc $(pkgconfigdir)
cp -P $(ANAME) $(LINKNAME) $(libdir)
uninstall: uninstall-prog uninstall-lib uninstall-dev
uninstall-prog:
$(RM) $(bindir)/$(PROGNAME)
$(RM) $(mandir)/man1/$(PROGNAME).1.gz
uninstall-lib:
$(RM) $(libdir)/$(ANAME) $(libdir)/$(SONAME) $(libdir)/$(REALNAME)
uninstall-dev:
$(RM) -r $(includedir)/iast $(includedir)/iast.h
$(RM) $(pkgconfigdir)/$(PROGNAME).pc
clean:
$(RM) $(PROGNAME) tests/test $(PROGNAME).1.gz
$(RM) -r $(LIBFILES) *.o */*.o */*.d *.d $(PROGNAME).pc
$(RM) *.gcda *.gcno tests/coverage */*.test
clean-aux:
$(RM) -r $(AUX_FILES)
distclean: clean clean-aux
ifeq ($(USE_GCOV),yes)
coverage:
$(MAKE) test
$(MKDIR_P) tests/coverage
lcov --no-external -c -d $(shell pwd) -o tests/coverage/coverage.info
genhtml -o tests/coverage -t "IAST Test Coverage" \
tests/coverage/coverage.info
endif
ifndef V
QUIET_CC = @echo " CC $@";
QUIET_LD = @echo " CCLD $@";
QUIET_AR = @echo " AR $@";
QUIET_LN = @echo " LN $@";
QUIET_GEN = @echo " GEN $@";
endif