2020-09-25 15:35:36 +02:00
|
|
|
SHELL = /bin/sh
|
|
|
|
CC = gcc
|
2018-06-06 10:56:44 +02:00
|
|
|
|
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
|
|
|
|
2020-01-02 16:12:51 +01: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
|
|
|
|
2020-01-01 17:52:21 +01:00
|
|
|
iast: main.o $(OBJECTS)
|
2018-06-09 16:20:43 +02:00
|
|
|
$(CC) $^ -o $@ $(CFLAGS)
|
2018-04-25 14:29:11 +02:00
|
|
|
|
2020-01-28 19:13:24 +01:00
|
|
|
test: iast tests/test
|
2020-01-01 17:15:07 +01:00
|
|
|
tests/test
|
2020-01-28 19:13:24 +01:00
|
|
|
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
|
|
|
|
2018-05-13 17:21:51 +02:00
|
|
|
install:
|
2020-09-25 15:35:36 +02:00
|
|
|
install -m 0755 iast $(BINDIR)
|
|
|
|
install -m 644 iast.1.gz $(MANDIR)/man1
|
2018-05-13 17:21:51 +02:00
|
|
|
|
|
|
|
uninstall:
|
2020-09-25 15:35:36 +02:00
|
|
|
rm -f $(BINDIR)/iast
|
|
|
|
rm -f $(MANDIR)/man1/iast.1.gz
|
2018-05-13 17:21:51 +02:00
|
|
|
|
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
|