diff options
author | Mattias Andrée <maandree@kth.se> | 2021-03-01 02:12:47 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-03-01 02:12:58 +0100 |
commit | eebadeb4b4ee60dc768afd3036e3a29833ccb51e (patch) | |
tree | e20184a304c0ba1160477b644504fbb2e8146319 /Makefile | |
parent | fix build (diff) | |
download | libhaiku-eebadeb4b4ee60dc768afd3036e3a29833ccb51e.tar.gz libhaiku-eebadeb4b4ee60dc768afd3036e3a29833ccb51e.tar.bz2 libhaiku-eebadeb4b4ee60dc768afd3036e3a29833ccb51e.tar.xz |
misc + change license + changed behaviour of libhaiku_perror
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b22a6af --- /dev/null +++ b/Makefile @@ -0,0 +1,61 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +# Change to macos.mk for Mac OS +OSCONFIGFILE = linux.mk +include $(OSCONFIGFILE) + + +LIB_MAJOR = 2 +LIB_MINOR = 0 + +LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR) + +MAN3 = libhaiku.7 +MAN7 = libhaiku_generic.3 libhaiku_perror.3 libhaiku_perror2.3 libhaiku_strerror.3 + + +all: libhaiku.a libhaiku.$(LIBEXT) + +libhaiku.o: libhaiku.c libhaiku.h + $(CC) -c -o $@ libhaiku.c $(CFLAGS) $(CPPFLAGS) + +libhaiku.lo: libhaiku.c libhaiku.h + $(CC) -fPIC -c -o $@ libhaiku.c $(CFLAGS) $(CPPFLAGS) + +libhaiku.$(LIBEXT): libhaiku.lo + $(CC) $(LIBFLAGS) -o $@ libhaiku.lo $(LDFLAGS) + +libhaiku.a: libhaiku.o + -rm -f -- $@ + $(AR) rc $@ libhaiku.o + $(AR) -s $@ + +install: libhaiku.$(LIBEXT) libhaiku.a + mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" + mkdir -p -- "$(DESTDIR)$(PREFIX)/include" + mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man3" + mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man7" + cp -- libhaiku.a "$(DESTDIR)$(PREFIX)/lib/" + cp -- libhaiku.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libhaiku.$(LIBMINOREXT)" + ln -sf -- libhaiku.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libhaiku.$(LIBMAJOREXT)" + ln -sf -- libhaiku.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libhaiku.$(LIBEXT)" + cp -- libhaiku.h "$(DESTDIR)$(PREFIX)/include/" + cp -- $(MAN3) "$(DESTDIR)$(MANPREFIX)/man3/" + cp -- $(MAN7) "$(DESTDIR)$(MANPREFIX)/man7/" + +uninstall: + -rm -f "$(DESTDIR)$(PREFIX)/lib/libhaiku.a" + -rm -f "$(DESTDIR)$(PREFIX)/lib/libhaiku.$(LIBMINOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libhaiku.$(LIBMAJOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libhaiku.$(LIBEXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/include/libhaiku.h" + -cd -- "$(DESTDIR)$(MANPREFIX)/man3/" && rm -rf -- $(MAN3) + -cd -- "$(DESTDIR)$(MANPREFIX)/man7/" && rm -rf -- $(MAN7) + +clean: + -rm -f -- *.o *.lo *.a *.su *.$(LIBEXT) *.$(LIBEXT).* *.*.$(LIBEXT) + +.PHONY: all install uninstall clean |