diff options
author | Mattias Andrée <maandree@kth.se> | 2021-03-01 02:16:25 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-03-01 02:16:25 +0100 |
commit | 4c1a6e380ebe76e256b2af1313cf256d9fea70df (patch) | |
tree | e20184a304c0ba1160477b644504fbb2e8146319 /Makefile | |
parent | Merge pull request #2 from ayekat/master (diff) | |
parent | misc + change license + changed behaviour of libhaiku_perror (diff) | |
download | libhaiku-4c1a6e380ebe76e256b2af1313cf256d9fea70df.tar.gz libhaiku-4c1a6e380ebe76e256b2af1313cf256d9fea70df.tar.bz2 libhaiku-4c1a6e380ebe76e256b2af1313cf256d9fea70df.tar.xz |
Merge branch 'rewrite'2.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | Makefile | 61 | ||||
-rw-r--r-- | Makefile.in | 84 |
2 files changed, 61 insertions, 84 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 diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 81156c4..0000000 --- a/Makefile.in +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (C) 2016 Mattias Andrée <maandree@member.fsf.org> -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without any warranty. - - -### This file will be stored to Makefile once you have run ./configure. ### -### See INSTALL for information on how to install this package. ### - - - -##### What is below this line is configurable, but is seldom useful. ##### - - -# Additional options for compiling info and HTML manuals. -INFO_FLAGS = - -# Additional options for compiling DVI, PDF, and PostScript manuals. -TEXINFO_FLAGS = - -# The name of the package as it should be installed. -PKGNAME = libhaiku - - - -##### Nothing interesting below this. ##### - - -# In case you want add some configurations. Primarily -# intended for maintainers. Perhaps add GPG_KEY here. -# Of course, you can declare everthing with ./configure, -# but with this you are less likely to forget it. --include .make-configurations - - -# YOU, AS A USER, SHOULD NOT CHANGE THESE VARIABLES. {{ -# They specify how the reusable makefiles in mk/ shall behave. - -# Package information. -_PROJECT = libhaiku -_VERSION = 1.0 - -# Used by mk/lang-c.mk -_C_STD = c99 -_PEDANTIC = yes -_LIB = libhaiku -_OBJ_libhaiku = libhaiku -_SO_VERSION_libhaiku = $(_VERSION) -_SO_MAJOR_libhaiku = $(shell echo $(_SO_VERSION_libhaiku) | cut -d . -f 1) -_H = libhaiku -_HEADER_DIRLEVELS = 1 -_CPPFLAGS = -D'PACKAGE="$(PKGNAME)"' -D'PROGRAM_VERSION="$(_VERSION)"' - -# Used by mk/texinfo.mk -_TEXINFO_DIRLEVELS = 2 -_INFOPARTS = 0 -_HAVE_TEXINFO_MANUAL = yes -_HTML_FILES = Free-Software-Needs-Free-Documentation.html GNU-Free-Documentation-License.html \ - GNU-General-Public-License.html index.html Overview.html - -# Used by mk/man.mk -_MAN_PAGE_SECTIONS = 3 7 -_MAN_3 = libhaiku_perror -_MAN_7 = libhaiku - -# Used by mk/copy.mk -_COPYING = COPYING - -# Used by mk/dist.mk -___EVERYTHING_INFO = autohaltd titlepage-data content hardcopy-copying \ - appx/fdl appx/free-software-needs-free-documentation appx/gpl \ - reusable/macros reusable/paper reusable/titlepage chap/overview -_EVERYTHING = $(__EVERYTHING_ALL_COMMON) src/libhaiku.c src/libhaiku.h \ - $(foreach F,$(___EVERYTHING_INFO),doc/info/$(F).texinfo) \ - DEPENDENCIES INSTALL NEWS - -# }} - - -# All of the make rules and the configurations. -include $(v)mk/all.mk - |