aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-21 16:38:52 +0100
committerMattias Andrée <maandree@kth.se>2023-01-21 16:38:52 +0100
commit38d23cbf5b3870830339c9c12fd30bd5270112d8 (patch)
treef9bdfab6d823497e0b80615acb3d3bde554c1b3d /Makefile
downloadlibglitter-38d23cbf5b3870830339c9c12fd30bd5270112d8.tar.gz
libglitter-38d23cbf5b3870830339c9c12fd30bd5270112d8.tar.bz2
libglitter-38d23cbf5b3870830339c9c12fd30bd5270112d8.tar.xz
Initial commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile72
1 files changed, 72 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..14674d2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,72 @@
+.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 = glitter
+
+
+OBJ =\
+ libglitter_compose_double.o\
+ libglitter_compose_float.o
+
+HDR =\
+ libglitter.h
+
+LOBJ = $(OBJ:.o=.lo)
+
+
+all: libglitter.a libglitter.$(LIBEXT)
+$(OBJ): $(HDR)
+$(LOBJ): $(HDR)
+libglitter_compose_float.o: libglitter_compose_double.c
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+.c.lo:
+ $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+libglitter.a: $(OBJ)
+ @rm -f -- $@
+ $(AR) rc $@ $(OBJ)
+ $(AR) ts $@ > /dev/null
+
+libglitter.$(LIBEXT): $(LOBJ)
+ $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS)
+
+install: libglitter.a libglitter.$(LIBEXT)
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
+ cp -- libglitter.a "$(DESTDIR)$(PREFIX)/lib/"
+ cp -- libglitter.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libglitter.$(LIBMINOREXT)"
+ $(FIX_INSTALL_NAME) "$(DESTDIR)$(PREFIX)/lib/libglitter.$(LIBMINOREXT)"
+ ln -sf -- libglitter.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libglitter.$(LIBMAJOREXT)"
+ ln -sf -- libglitter.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libglitter.$(LIBEXT)"
+ cp -- libglitter.h "$(DESTDIR)$(PREFIX)/include/"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libglitter.a"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libglitter.$(LIBMAJOREXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libglitter.$(LIBMINOREXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libglitter.$(LIBEXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/include/libglitter.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