aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile60
1 files changed, 60 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..84c04d5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,60 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+OBJ =\
+ libskrift_calculate_dpi.o\
+ libskrift_close_font.o\
+ libskrift_create_context.o\
+ libskrift_free_context.o\
+ libskrift_get_grapheme_glyph.o\
+ libskrift_get_cluster_glyph.o\
+ libskrift_get_rendering_settings.o\
+ libskrift_inches_to_pixels.o\
+ libskrift_merge_glyphs.o\
+ libskrift_millimeters_to_pixels.o\
+ libskrift_open_font.o\
+ libskrift_open_font_fd.o\
+ libskrift_open_font_file.o\
+ libskrift_open_font_mem.o\
+ libskrift_points_to_pixels.o
+
+LIB_HDR =\
+ libskrift.h
+
+HDR =\
+ common.h\
+ $(LIB_HDR)
+
+all: libskrift.a demo
+$(OBJ): $(@:.o=.c) $(HDR)
+demo.o: demo.c $(LIB_HDR)
+
+libskrift.a: $(OBJ)
+ $(AR) rc $@ $(OBJ)
+ $(AR) ts $@ > /dev/null
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+demo: demo.o libskrift.a
+ $(CC) -o $@ $@.o libskrift.a $(LDFLAGS)
+
+install: libskrift.a
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
+ cp -- libskrift.a "$(DESTDIR)$(PREFIX)/lib"
+ cp -- libskrift.h "$(DESTDIR)$(PREFIX)/include"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libskrift.a"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/include/libskrift.h"
+
+clean:
+ -rm -f -- *.o *.lo *.su libskrift.a libskrift.so libskrift.so.*
+
+.SUFFIXES:
+.SUFFIXES: .c .o
+
+.PHONY: all install uninstall clean