diff options
author | Mattias Andrée <maandree@kth.se> | 2021-11-09 23:53:14 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-11-09 23:53:14 +0100 |
commit | 848a90d0bf2af21e64b5d134bf0f7ff77f7bea49 (patch) | |
tree | b833871395ce1f64d95a5221e2573fff7424c4da /Makefile | |
download | libfonts-848a90d0bf2af21e64b5d134bf0f7ff77f7bea49.tar.gz libfonts-848a90d0bf2af21e64b5d134bf0f7ff77f7bea49.tar.bz2 libfonts-848a90d0bf2af21e64b5d134bf0f7ff77f7bea49.tar.xz |
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | Makefile | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..28289b7 --- /dev/null +++ b/Makefile @@ -0,0 +1,67 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +OS = linux +# Linux: linux +# Mac OS: macos +# Windows: windows +include mk/$(OS).mk + + +LIB_MAJOR = 1 +LIB_MINOR = 0 +LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR) +LIB_NAME = fonts + + +OBJ = + +HDR =\ + libfonts.h + +LOBJ = $(OBJ:.o=.lo) + + +all: libfonts.a libfonts.$(LIBEXT) +$(OBJ): $(HDR) +$(LOBJ): $(HDR) + +.c.o: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +.c.lo: + $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +libfonts.a: $(OBJ) + @rm -f -- $@ + $(AR) rc $@ $(OBJ) + +libfonts.$(LIBEXT): $(LOBJ) + $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS) + +install: libfonts.a libfonts.$(LIBEXT) + mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" + mkdir -p -- "$(DESTDIR)$(PREFIX)/include" + cp -- libfonts.a "$(DESTDIR)$(PREFIX)/lib/" + cp -- libfonts.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMINOREXT)" + ln -sf -- libfonts.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMAJOREXT)" + ln -sf -- libfonts.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBEXT)" + cp -- libfonts.h "$(DESTDIR)$(PREFIX)/include/" + +uninstall: + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libfonts.a" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMAJOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBMINOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libfonts.$(LIBEXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/include/libfonts.h" + +clean: + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib + -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) + +.SUFFIXES: +.SUFFIXES: .lo .o .c + +.PHONY: all install uninstall clean |