]> Nishi Git Mirror - dataworks.git/commitdiff
makefiles
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Sat, 18 May 2024 12:33:58 +0000 (12:33 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Sat, 18 May 2024 12:33:58 +0000 (12:33 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@31 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

GNUmakefile
Makefile
common-decl.mk [new file with mode: 0644]
common.mk [new file with mode: 0644]

index 56b94461c80eb6c1021a35354d62ab0ce7922e82..37fb4ed1b2546c230f37978f0f32a4a707652200 100644 (file)
@@ -1,49 +1,9 @@
 # $Id$
-CC = cc
-CFLAGS = -std=c99
-LDFLAGS = -L`pwd`/Library
-LIBS =
-LIB_PREFIX = lib
-LIB_SUFFIX = .so
-EXEC_SUFFIX =
-PLATFORM_M = `uname -m`
-PLATFORM_P = `uname -p`
+
+include common-decl.mk
 
 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)" PLATFORM_M="$(PLATFORM_M)" PLATFORM_P="$(PLATFORM_P)"
-
-.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)
+include common.mk
index be92580c1136923739f34df2f594424c11e3f07d..fe96d6a258ac4001a5ef5a8deeea78b1256f2d89 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,49 +1,9 @@
 # $Id$
-CC = cc
-CFLAGS = -std=c99
-LDFLAGS = -L`pwd`/Library
-LIBS =
-LIB_PREFIX = lib
-LIB_SUFFIX = .so
-EXEC_SUFFIX =
-PLATFORM_M = `uname -m`
-PLATFORM_P = `uname -p`
+
+include common-decl.mk
 
 .if "$(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)" PLATFORM_M="$(PLATFORM_M)" PLATFORM_P="$(PLATFORM_P)"
-
-.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)
+include common.mk
diff --git a/common-decl.mk b/common-decl.mk
new file mode 100644 (file)
index 0000000..03d5677
--- /dev/null
@@ -0,0 +1,11 @@
+# $Id$
+
+CC = cc
+CFLAGS = -std=c99
+LDFLAGS = -L`pwd`/Library
+LIBS =
+LIB_PREFIX = lib
+LIB_SUFFIX = .so
+EXEC_SUFFIX =
+PLATFORM_M = `uname -m`
+PLATFORM_P = `uname -p`
diff --git a/common.mk b/common.mk
new file mode 100644 (file)
index 0000000..43da375
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,50 @@
+# $Id$
+
+COMPILE_FLAGS = CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" LIB_PREFIX="$(LIB_PREFIX)" LIB_SUFFIX="$(LIB_SUFFIX)" EXEC_SUFFIX="$(EXEC_SUFFIX)" PLATFORM_M="$(PLATFORM_M)" PLATFORM_P="$(PLATFORM_P)"
+
+.PHONY: all no-doc replace format clean ./Library ./Client ./Document archive
+
+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:
+       rm -f *.zip *.tar.gz
+       $(MAKE) -C ./Library clean $(COMPILE_FLAGS)
+       $(MAKE) -C ./Client clean $(COMPILE_FLAGS)
+       $(MAKE) -C ./Document clean $(COMPILE_FLAGS)
+
+archive: no-doc
+       rm -f *.zip *.tar.gz
+       rm -rf dataworks-dist
+       mkdir -p dataworks-dist
+       mkdir -p dataworks-dist/Client
+       mkdir -p dataworks-dist/Library
+       cp Library/*$(LIB_SUFFIX) dataworks-dist/Library/
+       cp Library/*.h dataworks-dist/Library/
+       cp Client/dataworks$(EXEC_SUFFIX) dataworks-dist/Client/
+       zip -rv dataworks.zip dataworks-dist
+       tar czvf dataworks.tar.gz dataworks-dist
+       rm -rf dataworks-dist