sanskrit-iast/Makefile

45 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

2020-01-04 08:54:49 +01:00
PREFIX=/usr/local
.PHONY: main test install uninstall clean
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 =
TEST_CFLAGS = $(CFLAGS) $(shell pkg-config --cflags check)
TEST_LIBS = $(LIBS) $(shell pkg-config --libs check)
2018-04-26 18:49:23 +02:00
2018-07-26 14:43:38 +02:00
all: iast doc/iast.1.gz
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)
2018-07-26 14:43:38 +02:00
doc/%.gz: doc/%.adoc
asciidoctor -d manpage -b manpage $< -o $(<:.adoc=) && gzip -f $(<:.adoc=)
install:
2020-01-04 08:54:49 +01:00
install -m 0755 -d $(PREFIX)/bin $(PREFIX)/share/man/man1
install -m 0755 iast $(PREFIX)/bin
2018-07-26 14:43:38 +02:00
install -m 644 doc/iast.1.gz $(PREFIX)/share/man/man1
uninstall:
rm -f $(PREFIX)/bin/iast
2018-07-26 14:43:38 +02:00
rm -f $(PREFIX)/share/man/man1/$(PROGNAME).1.gz
2018-04-25 14:29:11 +02:00
clean:
2020-01-07 13:18:54 +01:00
$(RM) iast tests/test *.o */*.o *.d */*.d doc/*.gz