sanskrit-iast/Makefile.in

139 lines
3.3 KiB
Makefile
Raw Normal View History

2023-02-16 08:55:55 +01:00
PROGNAME = @PROGNAME@
VERSION = @PACKAGE_VERSION@
VERSION_FULL = $(VERSION)
VERSION_MAJOR = $(firstword $(subst ., ,$(VERSION)))
2021-05-02 21:30:30 +02:00
LIBNAME = lib@PROGNAME@
ANAME = $(LIBNAME).a
2023-02-16 08:55:55 +01:00
LINKNAME = $(LIBNAME).so
SONAME = $(LIBNAME).so.$(VERSION_MAJOR)
REALNAME = $(LIBNAME).so.$(VERSION_FULL)
LIBFILES = $(ANAME) $(LINKNAME) $(SONAME) $(REALNAME)
2021-02-23 07:52:17 +01:00
CC = @CC@
2021-05-02 21:30:30 +02:00
AR = @AR@
2023-02-16 08:55:55 +01:00
LN_S = @LN_S@
2021-02-23 07:52:17 +01:00
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
MKDIR_P = @MKDIR_P@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
2021-05-02 21:30:30 +02:00
libdir = @libdir@
2021-02-23 07:52:17 +01:00
datarootdir = @datarootdir@
2023-02-16 08:55:55 +01:00
includedir = @includedir@
2021-02-23 07:52:17 +01:00
mandir = @mandir@
2021-02-25 09:48:38 +01:00
USE_GCOV = @USE_GCOV@
CFLAGS = -Wall @CFLAGS@ @COVERAGE_CFLAGS@
LFLAGS = @COVERAGE_LFLAGS@
2021-02-23 07:52:17 +01:00
TEST_CFLAGS = @CFLAGS@ @CHECK_CFLAGS@
2021-02-25 09:48:38 +01:00
TEST_LFLAGS = @CHECK_LIBS@ @COVERAGE_LFLAGS@
2021-02-23 07:52:17 +01:00
2023-02-13 08:48:26 +01:00
OBJECTS = transliteration.o czech.o hindi.o utf8.o velthuis.o harvard-kyoto.o
2021-02-25 10:15:08 +01:00
2023-02-16 08:55:55 +01:00
INCLUDES = harvard-kyoto.h transliteration.h velthuis.h
2021-12-21 21:55:16 +01:00
TEST_OBJECTS = tests/main.o tests/translit.o tests/czech.o \
2023-02-13 08:48:26 +01:00
tests/hindi.o tests/velthuis.o tests/harvard-kyoto.o \
tests/utf8.o tests/integration.o
2021-02-23 07:52:17 +01:00
AUX_FILES = Makefile configure aclocal.m4 install-sh config.h* *.log \
*.status *.cache
2023-02-16 08:55:55 +01:00
all: $(PROGNAME) $(LIBFILES) tests/test $(PROGNAME).1.gz
2021-02-23 07:52:17 +01:00
include $(wildcard *.d tests/*.d)
2021-05-02 21:30:30 +02:00
$(PROGNAME): main.o $(ANAME)
2021-02-23 07:52:17 +01:00
$(QUIET_LD) $(CC) $^ -o $@ $(LFLAGS)
2021-05-02 21:30:30 +02:00
$(ANAME): $(OBJECTS)
$(QUIET_AR) $(AR) rcs $@ $^
2023-02-16 08:55:55 +01:00
$(REALNAME): $(OBJECTS)
$(QUIET_LD) $(CC) $^ -shared -o $@ $(LFLAGS)
$(SONAME): $(REALNAME)
$(QUIET_LN) $(LN_S) -f $< $@
$(LINKNAME): $(SONAME)
$(QUIET_LN) $(LN_S) -f $< $@
2021-03-12 19:33:56 +01:00
test: all
2021-02-23 07:52:17 +01:00
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)
2021-02-25 09:48:38 +01:00
$(QUIET_LD) $(CC) $^ -o $@ $(TEST_LFLAGS)
2021-02-23 07:52:17 +01:00
%.1.gz: %.1
$(QUIET_GEN) cat $< | gzip -f >$@
2023-02-16 08:55:55 +01:00
install: install-prog install-lib install-dev
install-prog:
2021-05-02 21:30:30 +02:00
$(MKDIR_P) $(bindir) $(libdir) $(mandir)/man1
2021-02-23 07:52:17 +01:00
$(INSTALL_PROGRAM) $(PROGNAME) $(bindir)
$(INSTALL_DATA) $(PROGNAME).1.gz $(mandir)/man1
2023-02-16 08:55:55 +01:00
install-lib:
$(MKDIR_P) $(libdir)
cp -P $(REALNAME) $(SONAME) $(libdir)
install-dev:
$(MKDIR_P) $(includedir)/iast $(libdir)
$(INSTALL_DATA) $(INCLUDES) $(includedir)/iast
$(INSTALL_DATA) iast.h $(includedir)
cp -P $(ANAME) $(LINKNAME) $(libdir)
uninstall: uninstall-prog uninstall-lib uninstall-dev
uninstall-prog:
2021-02-23 07:52:17 +01:00
$(RM) $(bindir)/$(PROGNAME)
$(RM) $(mandir)/man1/$(PROGNAME).1.gz
2023-02-16 08:55:55 +01:00
uninstall-lib:
$(RM) $(libdir)/$(ANAME) $(libdir)/$(SONAME) $(libdir)/$(REALNAME)
uninstall-dev:
$(RM) -r $(includedir)/iast $(includedir)/iast.h
2021-02-23 07:52:17 +01:00
clean:
$(RM) $(PROGNAME) tests/test $(PROGNAME).1.gz
2023-02-16 08:55:55 +01:00
$(RM) -r $(LIBFILES) *.o */*.o */*.d *.d
$(RM) *.gcda *.gcno tests/coverage */*.test
2021-02-23 07:52:17 +01:00
clean-aux:
$(RM) -r $(AUX_FILES)
distclean: clean clean-aux
2021-02-25 09:48:38 +01:00
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
2021-02-23 07:52:17 +01:00
ifndef V
QUIET_CC = @echo " CC $@";
QUIET_LD = @echo " CCLD $@";
2021-05-02 21:30:30 +02:00
QUIET_AR = @echo " AR $@";
2023-02-16 08:55:55 +01:00
QUIET_LN = @echo " LN $@";
2021-02-23 07:52:17 +01:00
QUIET_GEN = @echo " GEN $@";
endif