From 1b64c0ca9f6438c5bb35f34a46344030b61b789a Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 28 Apr 2024 17:47:08 +0000 Subject: build system: imported sofort, a project-agnostic build system. --- sofort/core/_infer/infer_modern.mk | 22 ++++++++++++++++++++++ sofort/core/_infer/infer_posix.mk | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 sofort/core/_infer/infer_modern.mk create mode 100644 sofort/core/_infer/infer_posix.mk (limited to 'sofort/core/_infer') 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 $@ -- cgit v1.2.3