sanskrit-iast/Makefile

43 lines
950 B
Makefile
Raw Normal View History

PREFIX=/usr
.PHONY: main test install uninstall clean
2018-04-25 14:29:11 +02:00
2020-01-01 17:15:07 +01:00
OBJECTS = iast.o transliteration.o utf8.o encoder.o
TEST_OBJECTS = tests/main.o tests/translit.o
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
2020-01-01 17:15:07 +01:00
test: tests/test
tests/test
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:
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:
2018-07-26 14:43:38 +02:00
$(RM) iast *.o *.d doc/*.gz