1
0
mirror of https://github.com/tomolt/libschrift synced 2025-04-29 16:19:33 -04:00

73 lines
2.1 KiB
Makefile
Raw Permalink Normal View History

2020-04-03 16:25:13 +02:00
# See LICENSE file for copyright and license details.
.POSIX:
include config.mk
2022-06-26 21:38:40 +02:00
VERSION=0.10.2
.PHONY: all clean install uninstall dist
2020-04-03 16:25:13 +02:00
2023-02-19 15:44:40 +01:00
all: libschrift.a libschrift.pc demo stress
2020-04-03 16:25:13 +02:00
libschrift.a: schrift.o
2020-04-24 22:03:57 +02:00
$(AR) rc $@ schrift.o
2020-04-04 17:41:10 +02:00
$(RANLIB) $@
schrift.o: schrift.h
2020-04-04 17:41:10 +02:00
2023-02-19 15:44:40 +01:00
libschrift.pc: libschrift.pc.in
@sed 's,@prefix@,$(PREFIX),;s,@version@,$(VERSION),' libschrift.pc.in > $@
2021-01-13 12:03:05 +01:00
demo: demo.o libschrift.a
$(LD) $(EXTRAS_LDFLAGS) $@.o -o $@ -L$(X11LIB) -L. -lX11 -lXrender -lschrift -lm
2021-01-13 12:03:05 +01:00
demo.o: demo.c schrift.h util/utf8_to_utf32.h
$(CC) -c $(EXTRAS_CFLAGS) $(@:.o=.c) -o $@ $(EXTRAS_CPPFLAGS) -I$(X11INC)
2021-01-13 12:03:05 +01:00
stress: stress.o libschrift.a
$(LD) $(EXTRAS_LDFLAGS) $@.o -o $@ -L. -lschrift -lm
stress.o: stress.c schrift.h util/arg.h
$(CC) -c $(EXTRAS_CFLAGS) $(@:.o=.c) -o $@ $(EXTRAS_CPPFLAGS)
2020-04-03 16:25:13 +02:00
clean:
rm -f *.o
rm -f util/*.o
2020-04-03 16:25:13 +02:00
rm -f libschrift.a
2021-01-13 12:03:05 +01:00
rm -f demo
rm -f stress
2020-04-03 16:25:13 +02:00
2023-02-19 15:44:40 +01:00
install: libschrift.a libschrift.pc schrift.h schrift.3
2020-04-19 13:56:44 +02:00
# libschrift.a
2020-04-03 16:25:13 +02:00
mkdir -p "$(DESTDIR)$(PREFIX)/lib"
cp -f libschrift.a "$(DESTDIR)$(PREFIX)/lib"
2020-04-19 13:56:44 +02:00
chmod 644 "$(DESTDIR)$(PREFIX)/lib/libschrift.a"
2023-02-19 15:44:40 +01:00
# libschrift.pc
mkdir -p "$(DESTDIR)$(PREFIX)/lib/pkgconfig"
cp -f libschrift.pc "$(DESTDIR)$(PREFIX)/lib/pkgconfig"
chmod 644 "$(DESTDIR)$(PREFIX)/lib/pkgconfig/libschrift.pc"
2020-04-19 13:56:44 +02:00
# schrift.h
2020-04-03 16:25:13 +02:00
mkdir -p "$(DESTDIR)$(PREFIX)/include"
cp -f schrift.h "$(DESTDIR)$(PREFIX)/include"
2020-04-19 13:56:44 +02:00
chmod 644 "$(DESTDIR)$(PREFIX)/include/schrift.h"
# schrift.3
2020-04-19 13:56:44 +02:00
mkdir -p "$(DESTDIR)$(MANPREFIX)/man3"
cp schrift.3 "$(DESTDIR)$(MANPREFIX)/man3"
chmod 644 "$(DESTDIR)$(MANPREFIX)/man3/schrift.3"
2020-04-03 16:25:13 +02:00
uninstall:
rm -f "$(DESTDIR)$(PREFIX)/lib/libschrift.a"
2023-02-19 15:44:40 +01:00
rm -f "$(DESTDIR)$(PREFIX)/lib/pkgconfig/libschrift.pc"
2020-04-03 16:25:13 +02:00
rm -f "$(DESTDIR)$(PREFIX)/include/schrift.h"
2020-04-19 13:56:44 +02:00
rm -f "$(DESTDIR)$(MANPREFIX)/man3/schrift.3"
2020-04-03 16:25:13 +02:00
2022-06-26 21:38:40 +02:00
dist:
rm -rf "schrift-$(VERSION)"
mkdir -p "schrift-$(VERSION)"
cp -R README.md LICENSE CHANGELOG.md TODO.md schrift.3 \
2023-02-19 15:44:40 +01:00
Makefile config.mk libschrift.pc.in \
2022-06-26 21:38:40 +02:00
schrift.c schrift.h demo.c stress.c \
resources/ util/ \
"schrift-$(VERSION)"
tar -cf - "schrift-$(VERSION)" | gzip -c > "schrift-$(VERSION).tar.gz"
rm -rf "schrift-$(VERSION)"