aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-12 23:05:22 +0200
committerMattias Andrée <maandree@kth.se>2021-04-12 23:05:22 +0200
commit90054e8a7df36eea21b612de6bd28d88e67989f9 (patch)
tree2fddd2123ea3aa13f7d4d031e685bd13979c4a38 /Makefile
downloadsecauth-90054e8a7df36eea21b612de6bd28d88e67989f9.tar.gz
secauth-90054e8a7df36eea21b612de6bd28d88e67989f9.tar.bz2
secauth-90054e8a7df36eea21b612de6bd28d88e67989f9.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile70
1 files changed, 70 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2ee23b3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,70 @@
+.POSIX:
+
+LIB_MAJOR = 1
+LIB_MINOR = 0
+LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR)
+
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+OS = linux
+# Linux: linux
+# Mac OS: macos
+# Windows: windows
+include mk/$(OS).mk
+
+
+
+OBJ =\
+ libsecauth_client_hash.o\
+ libsecauth_format_spec.o\
+ libsecauth_parse_spec.o\
+ libsecauth_server_hash.o
+
+HDR =\
+ libsecauth.h
+
+LOBJ = $(OBJ:.o=.lo)
+
+
+all: libsecauth.a libsecauth.$(LIBEXT)
+$(OBJ): $($@:.o=.c) $(HDR)
+
+libsecauth.a: $(OBJ)
+ -rm -f -- $@
+ $(AR) rc $@ $(OBJ)
+ $(AR) -s $@
+
+libsecauth.$(LIBEXT): $(LOBJ)
+ $(CC) $(LIBFLAGS) $(LDFLAGS_METHODS) -o $@ $(LOBJ) $(LDFLAGS)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+.c.lo:
+ $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+install: libsecauth.a libsecauth.$(LIBEXT)
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/lib"
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/include"
+ cp -- libsecauth.a "$(DESTDIR)$(PREFIX)/lib/"
+ cp -- libsecauth.h "$(DESTDIR)$(PREFIX)/include/"
+ cp -- libsecauth.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libsecauth.$(LIBMINOREXT)"
+ ln -sf -- libsecauth.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libsecauth.$(LIBMAJOREXT)"
+ ln -sf -- libsecauth.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libsecauth.$(LIBEXT)"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libsecauth.$(LIBMAJOREXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libsecauth.$(LIBMINOREXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libsecauth.$(LIBEXT)"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libsecauth.a"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/include/libsecauth.h"
+
+clean:
+ -rm -rf -- *.o *.a *.so *.lo *.su *.dll *.dylib
+
+.SUFFIXES:
+.SUFFIXES: .c .o .lo
+
+.PHONY: all install uninstall clean