aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-04-12 21:12:21 +0200
committerMattias Andrée <maandree@kth.se>2019-04-12 21:13:28 +0200
commitf7b4088919bed74397e55ce2eab7aad61df3c949 (patch)
tree7d470a11985d9f9d8221919704aa2092ef7ae8b3 /Makefile
downloadliberror-backtrace-f7b4088919bed74397e55ce2eab7aad61df3c949.tar.gz
liberror-backtrace-f7b4088919bed74397e55ce2eab7aad61df3c949.tar.bz2
liberror-backtrace-f7b4088919bed74397e55ce2eab7aad61df3c949.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile63
1 files changed, 63 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..924776d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,63 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+OS = linux
+# linux = Linux
+# macos = Mac OS
+include $(OS).mk
+
+LIB_MAJOR = 1
+LIB_MINOR = 0
+LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR)
+
+
+HDR =\
+ internal.h
+
+OBJ =\
+ print_backtrace.o\
+ save_backtrace.o
+
+LOBJ = $(OBJ:.o=.lo)
+
+
+all: liberror-backtrace.a liberror-backtrace.$(LIBEXT)
+$(OBJ): $(@:.o=.c) $(HDR)
+$(LOBJ): $(@:.lo=.c) $(HDR)
+
+liberror-backtrace.a: $(OBJ)
+ -rm -f -- $@
+ $(AR) rc $@ $(OBJ)
+ $(AR) s $@
+
+liberror-backtrace.$(LIBEXT): $(LOBJ)
+ $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+.c.lo:
+ $(CC) -c -o $@ $< -fPIC $(CFLAGS) $(CPPFLAGS)
+
+install: liberror-backtrace.a liberror-backtrace.$(LIBEXT)
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/licenses/liberror-backtrace"
+ cp -- liberror-backtrace.a "$(DESTDIR)$(PREFIX)/lib"
+ cp -- liberror-backtrace.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/liberror-backtrace.$(LIBMINOREXT)"
+ ln -sf -- liberror-backtrace.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/liberror-backtrace.$(LIBMAJOREXT)"
+ ln -sf -- liberror-backtrace.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/liberror-backtrace.$(LIBEXT)"
+ cp -- LICENSE "$(DESTDIR)$(PREFIX)/licenses/liberror-backtrace"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/liberror-backtrace."*
+ -rm -rf -- "$(DESTDIR)$(PREFIX)/licenses/liberror-backtrace"
+
+clean:
+ -rm -f -- *.o *.lo *.a *.so *.so.* *.su *.test
+
+.SUFFIXES:
+.SUFFIXES: .c .o .lo .a
+
+.PHONY: all install uninstall clean