From 6f3d10a3ec09cc278041ced4d4e506cb89a7c69a Mon Sep 17 00:00:00 2001 From: Ali Fardan Date: Wed, 18 Nov 2020 10:55:20 +0300 Subject: initial commit; todo: thorough testing --- Makefile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a3036be --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +AR = ar +CC = cc +CFLAGS = -g -O0 -Wall -Wextra -Wno-discarded-qualifiers +TARGET_LIB_DYNAMIC = libyuri.so +TARGET_LIB_STATIC = libyuri.a + +PREFIX = /usr + +OBJS = yuri.o decode.o encode.o normalize.o strlcpy.o strlcat.o +MANPAGES = + +all: $(TARGET_LIB_STATIC) $(TARGET_LIB_DYNAMIC) + +$(TARGET_LIB_STATIC): $(OBJS) + $(AR) rcs $@ $(OBJS) + +$(TARGET_LIB_DYNAMIC): $(OBJS) + $(CC) -shared -o $@ $(OBJS) + +test: $(TARGET_LIB_STATIC) + $(CC) -O0 -g -o $@ test.c $(TARGET_LIB_STATIC) + +install: all + mkdir -p $(PREFIX)/lib + cp $(TARGET_LIB_STATIC) $(PREFIX)/lib + cp $(TARGET_LIB_DYNAMIC) $(PREFIX)/lib + ldconfig -n $(PREFIX)/lib + mkdir -p $(PREFIX)/include + cp gemtext.h $(PREFIX)/include + mkdir -p $(PREFIX)/share/man/man3 + cp $(MANPAGES) $(PREFIX)/share/man/man3 + +clean: + rm -f $(TARGET_LIB_STATIC) $(TARGET_LIB_DYNAMIC) $(OBJS) test + +.PHONY: all clean -- cgit 1.4.1-2-gfad0