phony fail example
authorThomas Walker Lynch <thomas.lynch@reasoningtechnology.com>
Tue, 2 Apr 2019 10:51:53 +0000 (12:51 +0200)
committerThomas Walker Lynch <thomas.lynch@reasoningtechnology.com>
Tue, 2 Apr 2019 10:51:53 +0000 (12:51 +0200)
19 files changed:
makefile
module/da/makefile
module/da/makefile-flags
module/da/test/makefile
module/da/test/makefile-flags
module/db/include/db.h [deleted file]
module/db/lib/libdb.a [deleted file]
module/db/makefile
module/db/makefile-flags
module/dispatch/#makefile# [new file with mode: 0644]
module/dispatch/makefile
module/dispatch/makefile-flags
module/share/include/db.h [new file with mode: 0644]
module/share/lib/libda.a
module/share/lib/libdb.a [new file with mode: 0644]
module/tranche/makefile-flags
tool/lib/makefile-cc
try/phony_general_targets/makefile [new file with mode: 0644]
try/phony_general_targets/transcript.txt [new file with mode: 0644]

index af4d046..2cf9bb5 100755 (executable)
--- a/makefile
+++ b/makefile
@@ -5,7 +5,7 @@
 #    | grep -v deprecated | grep -v doc | sort -u | sed ':a;N;$!ba;s/\n/ /g' \
 #)
 
-MAKEABLE= module/da module/da/test module/tranche module/dispatch
+MAKEABLE= module/da module/da/test module/db module/tranche module/dispatch
 
 .PHONY: all info clean dist-clean
 
index 6f535ea..80b385d 100644 (file)
@@ -1,5 +1,4 @@
-# da/makefile
-
+# da/
 
 SHELL=/bin/bash
 MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tool/lib/makefile-cc
@@ -18,7 +17,11 @@ dep:
 .PHONY: lib
 lib:
        $(MAKE) $@
-       cp src/da.lib.h include/da.h
+       cp $(SRCDIR)/da.lib.h $(INCDIR)/da.h
+
+.PHONY: exec
+exec:
+       $(MAKE) $@
 
 %::
        $(MAKE) $@
index cb96c22..ae5fb48 100644 (file)
@@ -1,13 +1,26 @@
 
 MODULE=da
 
+DEPRDIR=deprecated
+DOCDIR=doc
+EXECDIR=exec
+INCDIR=include
+LIBDIR=lib
+SHAREDIR=../share
+SRCDIR=src
+TESTDIR=test
+TMPDIR=tmp
+TOOLDIR=$(realpath $(PROJECT_SUBU)/tool)
+TRYDIR=try
+
+DEPFILE=$(TMPDIR)/makefile-cc.deps
+LIBFILE=$(LIBDIR)/lib$(MODULE).a
+INCFILE=$(INCDIR)/$(MODULE).h
+
 # some versions of Linux need a -e option others complain if there is a -e .. and it isn't the binary for echo ..
 ECHO= echo
 #ECHO= echo -e
 
-# directories used by this makefile, these could all be set to dot for
-# the simplest source directory structure
-
 # compiler and flags
 C=gcc
 CFLAGS=-std=gnu11 -fPIC -I. -ggdb -Werror -DDEBUG -DDEBUGDB 
index b538ac2..9df325d 100644 (file)
@@ -6,17 +6,19 @@ MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tool/lib/makefile-cc
 
 -include makefile-flags
 
-.PHONY: all lib exec
-all: version deps lib exec
+.PHONY: all
+all: version
 
 .PHONY: dep
 dep:
        if [ -e $(DEPFILE) ]; then rm $(DEPFILE); fi
        $(MAKE) $@
 
+.PHONY: lib
 lib:
        $(MAKE) $@
 
+.PHONY: exec
 exec:
        $(MAKE) $@
 
index 1904d71..37ea9c1 100644 (file)
@@ -1,14 +1,26 @@
 
 MODULE=test
 
+DEPRDIR=deprecated
+DOCDIR=doc
+EXECDIR=exec
+INCDIR=include
+LIBDIR=lib
+SHAREDIR=../share
+SRCDIR=src
+TESTDIR=
+TMPDIR=tmp
+TOOLDIR=$(realpath $(PROJECT_SUBU)/tool)
+TRYDIR=try
+
+DEPFILE=$(TMPDIR)/makefile-cc.deps
+LIBFILE=$(LIBDIR)/lib$(MODULE).a
+INCFILE=$(INCDIR)/$(MODULE).h
+
 # some versions of Linux need a -e option others complain if there is a -e .. and it isn't the binary for echo ..
 ECHO= echo
 #ECHO= echo -e
 
-# directories used by this makefile, these could all be set to dot for
-# the simplest source directory structure
-TESTDIR=
-
 # compiler and flags
 C=gcc
 CFLAGS=-std=gnu11 -fPIC -I../include -ggdb -Werror -DDEBUG -DDEBUGDB 
diff --git a/module/db/include/db.h b/module/db/include/db.h
deleted file mode 100644 (file)
index 7563eea..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef DB_LIB_H
-#define DB_LIB_H
-
-int dbprintf(const char *format, ...);
-
-#endif
diff --git a/module/db/lib/libdb.a b/module/db/lib/libdb.a
deleted file mode 100644 (file)
index bf6ce01..0000000
Binary files a/module/db/lib/libdb.a and /dev/null differ
index 167b997..181818b 100644 (file)
@@ -1,5 +1,4 @@
-# da/makefile
-
+# db
 
 SHELL=/bin/bash
 MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tool/lib/makefile-cc
@@ -8,12 +7,17 @@ MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tool/lib/makefile-cc
 -include makefile-flags
 
 .PHONY: all
-all: version dep lib exec
+all: version
+
+.PHONY: dep
+dep:
+       if [ -e $(DEPFILE) ]; then rm $(DEPFILE); fi
+       $(MAKE) $@
 
 .PHONY: lib
 lib:
        $(MAKE) $@
-       cp src/db.lib.h include/db.h
+       cp $(SRCDIR)/db.lib.h $(INCDIR)/db.h
 
 %::
        $(MAKE) $@
index f37c595..65ef1be 100644 (file)
@@ -1,13 +1,26 @@
 
 MODULE=db
 
+DEPRDIR=deprecated
+DOCDIR=doc
+EXECDIR=exec
+INCDIR=include
+LIBDIR=lib
+SHAREDIR=../share
+SRCDIR=src
+TESTDIR=test
+TMPDIR=tmp
+TOOLDIR=$(realpath $(PROJECT_SUBU)/tool)
+TRYDIR=try
+
+DEPFILE=$(TMPDIR)/makefile-cc.deps
+LIBFILE=$(LIBDIR)/lib$(MODULE).a
+INCFILE=$(INCDIR)/$(MODULE).h
+
 # some versions of Linux need a -e option others complain if there is a -e .. and it isn't the binary for echo ..
 ECHO= echo
 #ECHO= echo -e
 
-# directories used by this makefile, these could all be set to dot for
-# the simplest source directory structure
-
 # compiler and flags
 C=gcc
 CFLAGS=-std=gnu11 -fPIC -I. -ggdb -Werror -DDEBUG -DDEBUGDB 
diff --git a/module/dispatch/#makefile# b/module/dispatch/#makefile#
new file mode 100644 (file)
index 0000000..d8fe923
--- /dev/null
@@ -0,0 +1,44 @@
+# src-dispatch/makefile
+
+SHELL=/bin/bash
+MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tool/lib/makefile-cc
+#MAKE=/usr/bin/make -f $(PROJECT_SUBU)/tool/lib/makefile-cc
+
+-include makefile-flags
+
+
+.PHONY: all 
+all: version
+
+.PHONY: info
+info:
+       @echo "TRCDIR: " $(TRCDIR)
+       $(MAKE) $@
+
+.PHONY: setup
+setup:
+       [ ! -e $(TRCDIR)  ]  && mkdir $(TRCDIR)  || true
+       $(MAKE) $@
+
+.PHONY: dep
+dep:
+       if [ -e $(DEPFILE) ]; then rm $(DEPFILE); fi
+       @trcsources=$(wildcard $(TRCDIR)/*.trc.c)$(wildcard $(TRCDIR)/*.trc.cc);\
+       if [ ! -z "$$trcsources" ]; then\
+         trctargets=$$(tranche-target $$trcsources -sep " " -tdir $(SRCDIR) );\
+         $(ECHO) $$trcsources;\
+         tranche-make $$trcsources -tdir $(SRCDIR) -mfile $(DEPFILE);\
+         $(MAKE) $$trctargets;\
+       fi
+       $(MAKE) $@
+
+.PHONY: lib
+lib:
+       $(MAKE) $@
+
+o%::
+       $(MAKE) $@
+
+
+
+
index 0714330..82d110d 100644 (file)
@@ -5,7 +5,7 @@ MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tool/lib/makefile-cc
 #MAKE=/usr/bin/make -f $(PROJECT_SUBU)/tool/lib/makefile-cc
 
 -include makefile-flags
-DEPFILE=$(TMPDIR)/makefile-cc.deps
+
 
 .PHONY: all 
 all: version
@@ -23,11 +23,10 @@ setup:
 .PHONY: dep
 dep:
        if [ -e $(DEPFILE) ]; then rm $(DEPFILE); fi
-       trcsources=$(wildcard $(TRCDIR)/*.trc.c)$(wildcard $(TRCDIR)/*.trc.cc);\
-       $(ECHO) $$trcsources;\
+       @trcsources=$(wildcard $(TRCDIR)/*.trc.c)$(wildcard $(TRCDIR)/*.trc.cc);\
        if [ ! -z "$$trcsources" ]; then\
          trctargets=$$(tranche-target $$trcsources -sep " " -tdir $(SRCDIR) );\
-         $(ECHO) $$trctargets;\
+         $(ECHO) $$trcsources;\
          tranche-make $$trcsources -tdir $(SRCDIR) -mfile $(DEPFILE);\
          $(MAKE) $$trctargets;\
        fi
index b493dae..854b84f 100644 (file)
@@ -1,22 +1,33 @@
 
 MODULE=dispatch
 
+DEPRDIR=deprecated
+DOCDIR=doc
+EXECDIR=exec
+INCDIR=include
+LIBDIR=lib
+SHAREDIR=../share
+SRCDIR=tmp
+TESTDIR=test
+TMPDIR=tmp
+TOOLDIR=$(realpath $(PROJECT_SUBU)/tool)
+TRCDIR=trc
+TRYDIR=try
+
+DEPFILE=$(TMPDIR)/makefile-trc.deps
+LIBFILE=$(LIBDIR)/lib$(MODULE).a
+INCFILE=$(INCDIR)/$(MODULE).h
+
 # some versions of Linux need a -e option others complain if there is a -e .. and it isn't the binary for echo ..
 ECHO= echo
 #ECHO= echo -e
 
-# directories used by this makefile, these could all be set to dot for
-# the simplest source directory structure
-
 # compiler and flags
 C=gcc
-CFLAGS=-std=gnu11 -fPIC -I. -ggdb -Werror -DDEBUG -DDEBUGDB 
-#CFLAGS=-std=gnu11 -fPIC -I. -Werror
+CFLAGS=-std=gnu11 -fPIC -I. -I../share/include -ggdb -Werror -DDEBUG -DDEBUGDB 
+#CFLAGS=-std=gnu11 -fPIC -I. -I../share/include -Werror
 
 LINKFLAGS=-L1_lib -lda 
 
-TMPDIR=tmp
-SRCDIR=tmp
-TRCDIR=trc
 
 
diff --git a/module/share/include/db.h b/module/share/include/db.h
new file mode 100644 (file)
index 0000000..7563eea
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef DB_LIB_H
+#define DB_LIB_H
+
+int dbprintf(const char *format, ...);
+
+#endif
index 0ca94fb..c6e819f 100644 (file)
Binary files a/module/share/lib/libda.a and b/module/share/lib/libda.a differ
diff --git a/module/share/lib/libdb.a b/module/share/lib/libdb.a
new file mode 100644 (file)
index 0000000..c40204a
Binary files /dev/null and b/module/share/lib/libdb.a differ
index cd54223..076600d 100644 (file)
@@ -1,15 +1,27 @@
 MODULE=tranche
 
+DEPRDIR=deprecated
+DOCDIR=doc
+EXECDIR=exec
+INCDIR=include
+LIBDIR=lib
+SHAREDIR=../share
+SRCDIR=src
+TESTDIR=
+TMPDIR=tmp
+TOOLDIR=$(realpath $(PROJECT_SUBU)/tool)
+TRYDIR=try
+
+DEPFILE=$(TMPDIR)/makefile-cc.deps
+LIBFILE=$(LIBDIR)/lib$(MODULE).a
+INCFILE=$(INCDIR)/$(MODULE).h
+
 # some versions of Linux need a -e option others complain if there is a -e .. and it isn't the binary for echo ..
 ECHO= echo
 #ECHO= echo -e
 
-# directories used by this makefile, these could all be set to dot for
-# the simplest source directory structure
-EXECDIR=exec
-
 C=gcc
 CFLAGS=-std=gnu11 -fPIC -I. -I../share/include -ggdb -Werror -DDEBUG -DDEBUGDB 
-#CFLAGS=-std=gnu11 -fPIC -I. -Werror
+#CFLAGS=-std=gnu11 -fPIC -I. -I../share/include -Werror
 LINKFLAGS=-Llib -L../share/lib/ -lda -ltranche
 
index de023af..4d548e9 100755 (executable)
@@ -31,7 +31,6 @@ EXEC= $(patsubst %, $(EXECDIR)/%, $(C_BASE_CLI) $(CC_BASE_CLI))
 
 # default directory seteup
 #
-
 DEPRDIR=deprecated
 DOCDIR=doc
 EXECDIR=exec
@@ -44,6 +43,10 @@ TMPDIR=tmp
 TOOLDIR=$(realpath $(PROJECT_SUBU)/tool)
 TRYDIR=try
 
+DEPFILE=$(TMPDIR)/makefile-cc.deps
+LIBFILE=$(LIBDIR)/lib$(MODULE).a
+INCFILE=$(INCDIR)/$(MODULE).h
+
 
 # a single space literal, for example if you wanted to subsitute commas to
 # spaces: $(subst $(space),;,$(string))
@@ -60,11 +63,6 @@ CC=
 
 -include makefile-flags
 
-DEPFILE=$(TMPDIR)/makefile-cc.deps
-LIBFILE=$(LIBDIR)/lib$(MODULE).a
-INCFILE=$(INCDIR)/$(MODULE).h
-
-
 #--------------------------------------------------------------------------------
 # targets
 
diff --git a/try/phony_general_targets/makefile b/try/phony_general_targets/makefile
new file mode 100644 (file)
index 0000000..07604b4
--- /dev/null
@@ -0,0 +1,11 @@
+
+
+.PHONY: lib version
+
+version:
+       @echo "version 0.1"
+
+%::
+       @echo $@
+
+
diff --git a/try/phony_general_targets/transcript.txt b/try/phony_general_targets/transcript.txt
new file mode 100644 (file)
index 0000000..56766ea
--- /dev/null
@@ -0,0 +1,42 @@
+2019-04-02T10:48:22Z
+user@host§~/subu_land/subu/try/phony_general_targets§
+> cat makefile 
+
+
+.PHONY: lib version
+
+version:
+       @echo "version 0.1"
+
+%::
+       @echo $@
+
+
+
+2019-04-02T10:48:27Z
+user@host§~/subu_land/subu/try/phony_general_targets§
+> mkdir version lib
+
+2019-04-02T10:48:38Z
+user@host§~/subu_land/subu/try/phony_general_targets§
+> ls
+lib  makefile  version
+
+2019-04-02T10:48:42Z
+user@host§~/subu_land/subu/try/phony_general_targets§
+> make version
+version 0.1
+
+2019-04-02T10:48:50Z
+user@host§~/subu_land/subu/try/phony_general_targets§
+> make code
+code
+
+2019-04-02T10:48:57Z
+user@host§~/subu_land/subu/try/phony_general_targets§
+> make lib
+make: Nothing to be done for 'lib'.
+
+2019-04-02T10:49:00Z
+user@host§~/subu_land/subu/try/phony_general_targets§
+>