summaryrefslogtreecommitdiffhomepage
path: root/sofort/core/_infer
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-04-28 17:47:08 +0000
committermidipix <writeonce@midipix.org>2024-04-28 17:47:08 +0000
commit1b64c0ca9f6438c5bb35f34a46344030b61b789a (patch)
treec1c41b3abf8af0c8fb2484681a7ef0e9707913ef /sofort/core/_infer
parent646efeb80e90cdc80e35a337273943b6ba87bb6f (diff)
downloadtreebnf-1b64c0ca9f6438c5bb35f34a46344030b61b789a.tar.bz2
treebnf-1b64c0ca9f6438c5bb35f34a46344030b61b789a.tar.xz
build system: imported sofort, a project-agnostic build system.
Diffstat (limited to 'sofort/core/_infer')
-rw-r--r--sofort/core/_infer/infer_modern.mk22
-rw-r--r--sofort/core/_infer/infer_posix.mk27
2 files changed, 49 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..aaf3361
--- /dev/null
+++ b/sofort/core/_infer/infer_modern.mk
@@ -0,0 +1,22 @@
+# 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 $@ $^
+
+srcs.tag:
+ touch $@
diff --git a/sofort/core/_infer/infer_posix.mk b/sofort/core/_infer/infer_posix.mk
new file mode 100644
index 0000000..ae990e8
--- /dev/null
+++ b/sofort/core/_infer/infer_posix.mk
@@ -0,0 +1,27 @@
+# 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)
+
+srcs.tag: tree.tag
+
+srcs.tag:
+ $(PROJECT_DIR)/sofort/tools/srctree.sh \
+ --srctree=$(SOURCE_DIR) -- \
+ $(COMMON_SRCS) $(APP_SRCS)
+ touch $@