summaryrefslogtreecommitdiffhomepage
path: root/sofort/core/_infer
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-10 10:40:45 +0000
committermidipix <writeonce@midipix.org>2021-04-10 20:54:49 +0000
commit1a7e555148acd7c025b3206e17e0daf8595b3a85 (patch)
tree72b25122d6d3cfd865aece8760494762e784c489 /sofort/core/_infer
parent52bf482a59246481766edaf6d8c21f45b4514304 (diff)
downloadperk-1a7e555148acd7c025b3206e17e0daf8595b3a85.tar.bz2
perk-1a7e555148acd7c025b3206e17e0daf8595b3a85.tar.xz
build system: posix make support: refactored project-agnostic inference rules.
Diffstat (limited to 'sofort/core/_infer')
-rw-r--r--sofort/core/_infer/infer_modern.mk19
-rw-r--r--sofort/core/_infer/infer_posix.mk19
2 files changed, 38 insertions, 0 deletions
diff --git a/sofort/core/_infer/infer_modern.mk b/sofort/core/_infer/infer_modern.mk
new file mode 100644
index 0000000..e7db2a6
--- /dev/null
+++ b/sofort/core/_infer/infer_modern.mk
@@ -0,0 +1,19 @@
+# infer_modern.mk: modern make target- and inference rules.
+# this file is covered by COPYING.SOFORT.
+
+src/%.ao: $(SOURCE_DIR)/src/%.c
+ $(CC) -c -o $@ $< $(CFLAGS_APP)
+
+src/%.lo: $(SOURCE_DIR)/src/%.c
+ $(CC) -c -o $@ $< $(CFLAGS_SHARED)
+
+src/%.o: $(SOURCE_DIR)/src/%.c
+ $(CC) -c -o $@ $< $(CFLAGS_STATIC)
+
+$(SHARED_LIB):
+ $(SHARED_LIB_CMD) $@ $^ $(SHARED_LIB_LDFLAGS) $(LDFLAGS_IMPLIB)
+
+lib/%$(OS_ARCHIVE_EXT):
+ mkdir -p lib
+ rm -f $@
+ $(AR) rcs $@ $^
diff --git a/sofort/core/_infer/infer_posix.mk b/sofort/core/_infer/infer_posix.mk
new file mode 100644
index 0000000..3938325
--- /dev/null
+++ b/sofort/core/_infer/infer_posix.mk
@@ -0,0 +1,19 @@
+# infer_posix.mk: posix make target- and inference rules.
+# this file is covered by COPYING.SOFORT.
+
+.c.ao:
+ $(CC) -c -o $@ $< $(CFLAGS_APP)
+
+.c.lo:
+ $(CC) -c -o $@ $< $(CFLAGS_SHARED)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS_STATIC)
+
+$(SHARED_LIB):
+ $(SHARED_LIB_CMD) $@ $(SHARED_OBJS) $(SHARED_LIB_LDFLAGS) $(LDFLAGS_IMPLIB)
+
+$(STATIC_LIB):
+ mkdir -p lib
+ rm -f $@
+ $(AR) rcs $@ $(STATIC_OBJS)