sanskrit-iast/Makefile

52 lines
1.1 KiB
Makefile
Raw Normal View History

2020-09-25 15:35:36 +02:00
SHELL = /bin/sh
CC = gcc
2020-09-25 15:35:36 +02:00
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man
2018-04-25 14:29:11 +02:00
OBJECTS = iast.o iast-czech.o transliteration.o transcription.o utf8.o encoder.o
2020-01-07 13:18:54 +01:00
TEST_OBJECTS = tests/main.o tests/translit.o tests/transcript.o tests/encoder.o
2020-01-01 17:15:07 +01:00
CFLAGS = -Wall
LIBS =
2020-09-25 15:35:36 +02:00
2020-01-01 17:15:07 +01:00
TEST_CFLAGS = $(CFLAGS) $(shell pkg-config --cflags check)
2020-09-25 15:35:36 +02:00
TEST_LIBS = $(shell pkg-config --libs check)
.PHONY: all main test install uninstall clean
2018-04-26 18:49:23 +02:00
2020-09-25 15:35:36 +02:00
all: iast iast.1.gz
2018-04-26 18:49:23 +02:00
2020-09-25 15:35:36 +02:00
include $(wildcard *.d)
2018-07-26 14:43:38 +02:00
iast: main.o $(OBJECTS)
2018-06-09 16:20:43 +02:00
$(CC) $^ -o $@ $(CFLAGS)
2018-04-25 14:29:11 +02:00
test: iast tests/test
2020-01-01 17:15:07 +01:00
tests/test
sh tests/integration.sh
2018-04-26 13:39:53 +02:00
2018-04-26 18:49:23 +02:00
%.o: %.c
2018-06-09 16:20:43 +02:00
$(CC) -MMD -MP -c $< -o $@ $(CFLAGS)
2018-04-26 18:49:23 +02:00
2020-01-01 17:15:07 +01:00
tests/%.o: tests/%.c
$(CC) -MMD -MP -c $< -o $@ $(TEST_CFLAGS) $(TEST_LIBS)
tests/test: $(OBJECTS) $(TEST_OBJECTS)
$(CC) $^ -o $@ $(TEST_CFLAGS) $(TEST_LIBS)
2020-09-25 15:35:36 +02:00
%.1.gz: %.1
cat $< | gzip -f >$@
2018-07-26 14:43:38 +02:00
install:
2020-09-25 15:35:36 +02:00
install -m 0755 iast $(BINDIR)
install -m 644 iast.1.gz $(MANDIR)/man1
uninstall:
2020-09-25 15:35:36 +02:00
rm -f $(BINDIR)/iast
rm -f $(MANDIR)/man1/iast.1.gz
2018-04-25 14:29:11 +02:00
clean:
2020-09-25 15:35:36 +02:00
$(RM) iast tests/test *.o */*.o *.d */*.d *.1.gz