]> Nishi Git Mirror - dataworks.git/commitdiff
gnu make should work too
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Thu, 16 May 2024 16:02:36 +0000 (16:02 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Thu, 16 May 2024 16:02:36 +0000 (16:02 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@8 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

GNUmakefile [new file with mode: 0644]
Makefile

diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644 (file)
index 0000000..74060d3
--- /dev/null
@@ -0,0 +1,47 @@
+# $Id$
+CC = cc
+CFLAGS = -std=c99
+LDFLAGS = -L`pwd`/Library
+LIBS =
+LIB_PREFIX = lib
+LIB_SUFFIX = .so
+EXEC_SUFFIX =
+
+ifneq ("$(PLATFORM)", "")
+include Platforms/$(PLATFORM).mk
+endif
+
+COMPILE_FLAGS = CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" LIB_PREFIX="$(LIB_PREFIX)" LIB_SUFFIX="$(LIB_SUFFIX)" EXEC_SUFFIX="$(EXEC_SUFFIX)"
+
+.PHONY: all no-doc replace format clean ./Library ./Client ./Document
+
+all: ./Library ./Client ./Document
+
+no-doc: ./Library ./Client
+
+./Library::
+       $(MAKE) -C $@ $(COMPILE_FLAGS)
+
+./Client:: ./Library
+       $(MAKE) -C $@ $(COMPILE_FLAGS)
+
+./Document::
+       $(MAKE) -C ./Document $(COMPILE_FLAGS)
+
+FILES = `find . -name "*.c" -or -name "*.h"`
+
+replace:
+       for i in $(FILES); do \
+                echo -n "$$i ... "; \
+                perl replace.pl < $$i > $$i.new; \
+                mv $$i.new $$i; \
+                echo "done"; \
+        done
+
+format:
+       clang-format -i $(FILES)
+
+clean:
+       $(MAKE) -C ./Library clean $(COMPILE_FLAGS)
+       $(MAKE) -C ./Client clean $(COMPILE_FLAGS)
+       $(MAKE) -C ./Document clean $(COMPILE_FLAGS)
index 6d253a6b9cf9913dffa028844e34c7edab33a397..d6da39df0e1a9b1986b1a6ae783887ab5388695f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ LIB_SUFFIX = .so
 EXEC_SUFFIX =
 
 .if "$(PLATFORM)" != ""
-.include "Platforms/$(PLATFORM).mk"
+.include Platforms/$(PLATFORM).mk
 .endif
 
 COMPILE_FLAGS = CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" LIB_PREFIX="$(LIB_PREFIX)" LIB_SUFFIX="$(LIB_SUFFIX)" EXEC_SUFFIX="$(EXEC_SUFFIX)"