summaryrefslogtreecommitdiff
path: root/sysinfo/os
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-29 13:58:33 -0400
committermidipix <writeonce@midipix.org>2016-10-31 14:57:14 -0400
commit8be3778f436d9e60d9e33bc7bbd07a1453ecd1f6 (patch)
tree9a521176bbe2505810f895b4ef6be15922585c24 /sysinfo/os
parent5c577bdd1f6ecc2b76d125b5af69177467c8d2f3 (diff)
downloadbfirm-8be3778f436d9e60d9e33bc7bbd07a1453ecd1f6.tar.bz2
bfirm-8be3778f436d9e60d9e33bc7bbd07a1453ecd1f6.tar.xz
build system: created skeleton.
Diffstat (limited to 'sysinfo/os')
-rw-r--r--sysinfo/os/any-os.mk12
-rw-r--r--sysinfo/os/bsd.mk12
-rw-r--r--sysinfo/os/darwin.mk14
-rw-r--r--sysinfo/os/elf.mk2
-rw-r--r--sysinfo/os/linux.mk12
-rw-r--r--sysinfo/os/midipix.mk10
-rw-r--r--sysinfo/os/mingw.mk12
-rw-r--r--sysinfo/os/pe.mk73
8 files changed, 147 insertions, 0 deletions
diff --git a/sysinfo/os/any-os.mk b/sysinfo/os/any-os.mk
new file mode 100644
index 0000000..cf8ec00
--- /dev/null
+++ b/sysinfo/os/any-os.mk
@@ -0,0 +1,12 @@
+OS = any-os
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .so
+OS_IMPLIB_EXT = .invalid
+OS_LIBDEF_EXT = .invalid
+OS_ARCHIVE_EXT = .a
+OS_SONAME = symlink
+OS_BINFMT = ELF
+
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/bsd.mk b/sysinfo/os/bsd.mk
new file mode 100644
index 0000000..6e8fac0
--- /dev/null
+++ b/sysinfo/os/bsd.mk
@@ -0,0 +1,12 @@
+OS = bsd
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .so
+OS_IMPLIB_EXT = .invalid
+OS_LIBDEF_EXT = .invalid
+OS_ARCHIVE_EXT = .a
+OS_SONAME = symlink
+OS_BINFMT = ELF
+
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/darwin.mk b/sysinfo/os/darwin.mk
new file mode 100644
index 0000000..5a0b99e
--- /dev/null
+++ b/sysinfo/os/darwin.mk
@@ -0,0 +1,14 @@
+OS = darwin
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .dylib
+OS_IMPLIB_EXT = .invalid
+OS_LIBDEF_EXT = .invalid
+OS_ARCHIVE_EXT = .a
+OS_SONAME = symlink
+OS_BINFMT = MACHO
+
+CFLAGS_OS += -D_DARWIN_C_SOURCE
+
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/elf.mk b/sysinfo/os/elf.mk
new file mode 100644
index 0000000..5a3940f
--- /dev/null
+++ b/sysinfo/os/elf.mk
@@ -0,0 +1,2 @@
+LDFLAGS_SHARED += -Wl,-soname
+LDFLAGS_SHARED += -Wl,$(DSO_SONAME)
diff --git a/sysinfo/os/linux.mk b/sysinfo/os/linux.mk
new file mode 100644
index 0000000..082026b
--- /dev/null
+++ b/sysinfo/os/linux.mk
@@ -0,0 +1,12 @@
+OS = linux
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .so
+OS_IMPLIB_EXT = .invalid
+OS_LIBDEF_EXT = .invalid
+OS_ARCHIVE_EXT = .a
+OS_SONAME = symlink
+OS_BINFMT = ELF
+
+.PHONY: $(IMPLIB_DEF) $(IMPLIB_VER) $(IMPLIB_SONAME) $(IMPLIB_SOLINK)
diff --git a/sysinfo/os/midipix.mk b/sysinfo/os/midipix.mk
new file mode 100644
index 0000000..31ba374
--- /dev/null
+++ b/sysinfo/os/midipix.mk
@@ -0,0 +1,10 @@
+OS = midipix
+OS_APP_PREFIX =
+OS_APP_SUFFIX =
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .so
+OS_IMPLIB_EXT = .lib.a
+OS_LIBDEF_EXT = .so.def
+OS_ARCHIVE_EXT = .a
+OS_SONAME = copy
+OS_BINFMT = PE
diff --git a/sysinfo/os/mingw.mk b/sysinfo/os/mingw.mk
new file mode 100644
index 0000000..6ade8d5
--- /dev/null
+++ b/sysinfo/os/mingw.mk
@@ -0,0 +1,12 @@
+OS = mingw
+OS_APP_PREFIX =
+OS_APP_SUFFIX = .exe
+OS_LIB_PREFIX = lib
+OS_LIB_SUFFIX = .dll
+OS_IMPLIB_EXT = .dll.a
+OS_LIBDEF_EXT = .def
+OS_ARCHIVE_EXT = .a
+OS_SONAME = copy
+OS_BINFMT = PE
+
+CFLAGS_PIC =
diff --git a/sysinfo/os/pe.mk b/sysinfo/os/pe.mk
new file mode 100644
index 0000000..ab7b79f
--- /dev/null
+++ b/sysinfo/os/pe.mk
@@ -0,0 +1,73 @@
+LDFLAGS_IMPLIB += -Wl,--output-def
+LDFLAGS_IMPLIB += -Wl,$(IMPLIB_DEF)
+LDFLAGS_SHARED += $(LDFLAGS_IMPLIB)
+
+LDFLAGS_SHARED += -Wl,-soname
+LDFLAGS_SHARED += -Wl,$(DSO_SONAME)
+
+PE_SUBSYSTEM ?= windows
+LDFLAGS_COMMON += -Wl,--subsystem=$(PE_SUBSYSTEM)
+
+implib: implib-ver package-implib-soname package-implib-solink
+
+implib-ver: shared-lib $(IMPLIB_VER)
+
+implib-soname: shared-lib $(IMPLIB_SONAME)
+
+implib-solink: shared-lib $(IMPLIB_SOLINK)
+
+$(IMPLIB_DEF): shared-lib
+
+$(IMPLIB_VER): $(IMPLIB_DEF)
+ $(DLLTOOL) -l $(IMPLIB_VER) -d $(IMPLIB_DEF) -D $(DSO_VER)
+
+install-implib: install-implib-ver \
+ package-install-implib-soname \
+ package-install-implib-solink
+
+install-implib-ver: implib-ver
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ cp $(IMPLIB_VER) $(DESTDIR)$(LIBDIR)
+
+clean-implib:
+ rm -f $(SHARED_LIB)
+ rm -f $(IMPLIB_DEF)
+ rm -f $(IMPLIB_VER)
+ rm -f $(IMPLIB_SONAME)
+ rm -f $(IMPLIB_SOLINK)
+
+
+ifeq ($(AVOID_VERSION),yes)
+
+package-implib-soname:
+package-implib-solink:
+package-install-implib-soname:
+package-install-implib-solink:
+
+else
+
+package-implib-soname: implib-soname
+package-implib-solink: implib-solink
+package-install-implib-soname: install-implib-soname
+package-install-implib-solink: install-implib-solink
+
+
+$(IMPLIB_SONAME): $(IMPLIB_DEF)
+ $(DLLTOOL) -l $(IMPLIB_SONAME) -d $(IMPLIB_DEF) -D $(DSO_SONAME)
+
+$(IMPLIB_SOLINK): $(IMPLIB_SONAME)
+ rm -f $(IMPLIB_SOLINK).tmp
+ ln -s $(IMP_SONAME) $(IMPLIB_SOLINK).tmp
+ mv $(IMPLIB_SOLINK).tmp $(IMPLIB_SOLINK)
+
+install-implib-soname: implib-soname
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ cp $(IMPLIB_SONAME) $(DESTDIR)$(LIBDIR)
+
+install-implib-solink: implib-soname
+ mkdir -p $(DESTDIR)$(LIBDIR)
+ rm -f $@.tmp
+ ln -s $(IMP_SONAME) $@.tmp
+ mv $@.tmp $(DESTDIR)$(LIBDIR)/$(IMP_SOLINK)
+
+endif