From 4e4b6683c8be2c859180f6784436f343664a2bf2 Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Thu, 28 Mar 2019 02:11:15 +0100 Subject: [PATCH] new structure in prep for using tranche --- da/makefile | 21 ++ src-da/0_makefile-flags => da/makefile-flags | 28 ++- {src-da => da/src}/da.lib.c | 0 {src-da => da/src}/da.lib.h | 0 da/test/makefile | 15 ++ da/test/makefile-dep | 5 + .../test/makefile-flags | 18 +- {src-da/1_tests => da/test}/results | 0 {src-da/1_tests => da/test}/test.dat | 0 {src-da/1_tests => da/test}/test_da.cli.c | 0 da/test/test_da.cli.o | Bin 0 -> 7584 bytes {src-da/1_tests => da/test}/test_da.lib.c | 0 {src-da/1_tests => da/test}/test_da.lib.h | 0 da/test/test_da.lib.o | Bin 0 -> 10768 bytes {src-0 => db}/0_makefile | 0 {src-0 => db}/0_makefile-flags | 0 .../1_doc/return-from-transaction.txt | 0 {src-db => db}/dbprintf.lib.c | 0 dispatch/makefile | 14 ++ dispatch/makefile-flags | 20 ++ .../src/dispatch.lib.c | 14 +- doc/dir-structure.txt | 27 +-- makefile | 27 +-- src-da/0_makefile | 18 -- src-da/1_include/da.h | 33 --- src-da/1_tests/0_makefile | 14 -- src-dispatch/0_makefile | 18 -- src-tranche/0_makefile | 18 -- src-tranche/0_makefile-flags | 45 ----- src-tranche/1_include/tranche.h | 8 - src-tranche/1_tests/0_makefile | 14 -- src-tranche/1_tests/0_makefile-flags | 33 --- {src-db => subu-0}/0_makefile | 0 {src-db => subu-0}/0_makefile-flags | 0 .../1_deprecated/dispatch_exec.lib.c | 0 .../1_deprecated/dispatch_f.lib.c | 0 .../1_deprecated/dispatch_useradd.lib.c | 0 .../1_deprecated/subu-rm-0.lib.c | 0 .../1_deprecated/subudb-number-next.cli.c | 0 {src-0 => subu-0}/1_doc/to_do.txt | 0 {src-0 => subu-0}/1_tests/0_makefile | 0 {src-0 => subu-0}/1_tests/0_makefile_flags | 0 {src-0 => subu-0}/1_tests/1_tmp/makefile_deps | 0 {src-0 => subu-0}/1_tests/da.cli.c | 0 {src-0 => subu-0}/1_tests/libtests.a | 0 {src-0 => subu-0}/1_tmp/da.lib.h | 0 {src-0 => subu-0}/1_tmp/dbprintf.lib.h | 0 {src-0 => subu-0}/1_tmp/dispatch.lib.h | 0 {src-0 => subu-0}/1_tmp/subu-bind-all.cli.h | 0 {src-0 => subu-0}/1_tmp/subu-bind.cli.h | 0 {src-0 => subu-0}/1_tmp/subu-common.lib.h | 0 {src-0 => subu-0}/1_tmp/subu-mk-0.cli.h | 0 {src-0 => subu-0}/1_tmp/subu-rm-0.cli.h | 0 {src-0 => subu-0}/1_tmp/subu.lib.h | 0 {src-0 => subu-0}/1_tmp/subudb-init.cli.h | 0 {src-0 => subu-0}/1_tmp/subudb-number.cli.h | 0 {src-0 => subu-0}/1_tmp/subudb-rel-get.cli.h | 0 {src-0 => subu-0}/1_tmp/subudb-rel-put.cli.h | 0 {src-0 => subu-0}/1_tmp/subudb-rel-rm.cli.h | 0 {src-0 => subu-0}/1_tmp/subudb-subus.cli.h | 0 {src-0 => subu-0}/1_tmp/subudb.lib.h | 0 {src-0 => subu-0}/1_try/split.c | 0 {src-0 => subu-0}/1_try/split_arg.c | 0 {src-0 => subu-0}/1_try/subudb | 0 {src-0 => subu-0}/1_try/voidptr.c | 0 {src-0 => subu-0}/common.lib.c | 0 {src-0 => subu-0}/db.lib.c | 0 {src-0 => subu-0}/subu-bind-all.cli.c | 0 {src-0 => subu-0}/subu-bind.cli.c | 0 {src-0 => subu-0}/subu-mk-0.cli.c | 0 {src-0 => subu-0}/subu-rm-0.cli.c | 0 {src-0 => subu-0}/subu.lib.c | 0 {src-0 => subu-0}/subudb-init.cli.c | 0 {src-0 => subu-0}/subudb-number.cli.c | 0 {src-0 => subu-0}/subudb-rel-get.cli.c | 0 {src-0 => subu-0}/subudb-rel-put.cli.c | 0 {src-0 => subu-0}/subudb-rel-rm.cli.c | 0 {src-0 => subu-0}/subudb-subus.cli.c | 0 {src-py => subu-1}/subu-mk.py | 0 tools/bin/make | 11 - tools/bin/tranche | Bin 0 -> 30584 bytes tools/lib/makefile_cc | 184 +++++++++-------- tools/lib/makefile_trc | 188 ++++++++++++++++++ .../deprecated}/0_makefile | 0 .../deprecated}/0_makefile-flags | 0 {src-tranche/1_doc => tranche/doc}/todo.txt | 0 tranche/makefile | 22 ++ .../makefile-flags | 30 ++- {src-tranche => tranche/src}/tranche.cli.c | 0 {src-tranche => tranche/src}/tranche.lib.c | 9 +- {src-tranche => tranche/src}/tranche.lib.h | 0 .../1_tests => tranche/test}/test1.dat | 0 .../1_tests => tranche/test}/test1.sh | 0 .../test}/test11.dat.expected | 0 .../test}/test12.dat.expected | 0 .../test}/test13.dat.expected | 0 .../test}/test14.dat.expected | 0 .../test}/test15.dat.expected | 0 .../test}/test1stdout.dat.expected | 0 tranche/test/test2.c.expected | 10 + tranche/test/test2.h.expected | 4 + tranche/test/test2.trc.c | 23 +++ {src-tranche/1_tests => tranche/test}/tranche | 0 103 files changed, 488 insertions(+), 383 deletions(-) create mode 100644 da/makefile rename src-da/0_makefile-flags => da/makefile-flags (74%) rename {src-da => da/src}/da.lib.c (100%) rename {src-da => da/src}/da.lib.h (100%) create mode 100644 da/test/makefile create mode 100644 da/test/makefile-dep rename src-da/1_tests/0_makefile-flags => da/test/makefile-flags (77%) rename {src-da/1_tests => da/test}/results (100%) rename {src-da/1_tests => da/test}/test.dat (100%) rename {src-da/1_tests => da/test}/test_da.cli.c (100%) create mode 100644 da/test/test_da.cli.o rename {src-da/1_tests => da/test}/test_da.lib.c (100%) rename {src-da/1_tests => da/test}/test_da.lib.h (100%) create mode 100644 da/test/test_da.lib.o rename {src-0 => db}/0_makefile (100%) rename {src-0 => db}/0_makefile-flags (100%) rename {src-db => db}/1_doc/return-from-transaction.txt (100%) rename {src-db => db}/dbprintf.lib.c (100%) create mode 100644 dispatch/makefile create mode 100644 dispatch/makefile-flags rename src-dispatch/dispatch.src.c => dispatch/src/dispatch.lib.c (96%) delete mode 100644 src-da/0_makefile delete mode 100644 src-da/1_include/da.h delete mode 100644 src-da/1_tests/0_makefile delete mode 100644 src-dispatch/0_makefile delete mode 100644 src-tranche/0_makefile delete mode 100644 src-tranche/0_makefile-flags delete mode 100644 src-tranche/1_include/tranche.h delete mode 100644 src-tranche/1_tests/0_makefile delete mode 100644 src-tranche/1_tests/0_makefile-flags rename {src-db => subu-0}/0_makefile (100%) rename {src-db => subu-0}/0_makefile-flags (100%) rename {src-0 => subu-0}/1_deprecated/dispatch_exec.lib.c (100%) rename {src-0 => subu-0}/1_deprecated/dispatch_f.lib.c (100%) rename {src-0 => subu-0}/1_deprecated/dispatch_useradd.lib.c (100%) rename {src-0 => subu-0}/1_deprecated/subu-rm-0.lib.c (100%) rename {src-0 => subu-0}/1_deprecated/subudb-number-next.cli.c (100%) rename {src-0 => subu-0}/1_doc/to_do.txt (100%) rename {src-0 => subu-0}/1_tests/0_makefile (100%) rename {src-0 => subu-0}/1_tests/0_makefile_flags (100%) rename {src-0 => subu-0}/1_tests/1_tmp/makefile_deps (100%) rename {src-0 => subu-0}/1_tests/da.cli.c (100%) rename {src-0 => subu-0}/1_tests/libtests.a (100%) rename {src-0 => subu-0}/1_tmp/da.lib.h (100%) rename {src-0 => subu-0}/1_tmp/dbprintf.lib.h (100%) rename {src-0 => subu-0}/1_tmp/dispatch.lib.h (100%) rename {src-0 => subu-0}/1_tmp/subu-bind-all.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subu-bind.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subu-common.lib.h (100%) rename {src-0 => subu-0}/1_tmp/subu-mk-0.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subu-rm-0.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subu.lib.h (100%) rename {src-0 => subu-0}/1_tmp/subudb-init.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subudb-number.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subudb-rel-get.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subudb-rel-put.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subudb-rel-rm.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subudb-subus.cli.h (100%) rename {src-0 => subu-0}/1_tmp/subudb.lib.h (100%) rename {src-0 => subu-0}/1_try/split.c (100%) rename {src-0 => subu-0}/1_try/split_arg.c (100%) rename {src-0 => subu-0}/1_try/subudb (100%) rename {src-0 => subu-0}/1_try/voidptr.c (100%) rename {src-0 => subu-0}/common.lib.c (100%) rename {src-0 => subu-0}/db.lib.c (100%) rename {src-0 => subu-0}/subu-bind-all.cli.c (100%) rename {src-0 => subu-0}/subu-bind.cli.c (100%) rename {src-0 => subu-0}/subu-mk-0.cli.c (100%) rename {src-0 => subu-0}/subu-rm-0.cli.c (100%) rename {src-0 => subu-0}/subu.lib.c (100%) rename {src-0 => subu-0}/subudb-init.cli.c (100%) rename {src-0 => subu-0}/subudb-number.cli.c (100%) rename {src-0 => subu-0}/subudb-rel-get.cli.c (100%) rename {src-0 => subu-0}/subudb-rel-put.cli.c (100%) rename {src-0 => subu-0}/subudb-rel-rm.cli.c (100%) rename {src-0 => subu-0}/subudb-subus.cli.c (100%) rename {src-py => subu-1}/subu-mk.py (100%) delete mode 100755 tools/bin/make create mode 100755 tools/bin/tranche create mode 100644 tools/lib/makefile_trc rename {src-tranche/1_deprecated => tranche/deprecated}/0_makefile (100%) rename {src-tranche/1_deprecated => tranche/deprecated}/0_makefile-flags (100%) rename {src-tranche/1_doc => tranche/doc}/todo.txt (100%) create mode 100644 tranche/makefile rename src-dispatch/0_makefile-flags => tranche/makefile-flags (64%) rename {src-tranche => tranche/src}/tranche.cli.c (100%) rename {src-tranche => tranche/src}/tranche.lib.c (94%) rename {src-tranche => tranche/src}/tranche.lib.h (100%) rename {src-tranche/1_tests => tranche/test}/test1.dat (100%) rename {src-tranche/1_tests => tranche/test}/test1.sh (100%) rename {src-tranche/1_tests => tranche/test}/test11.dat.expected (100%) rename {src-tranche/1_tests => tranche/test}/test12.dat.expected (100%) rename {src-tranche/1_tests => tranche/test}/test13.dat.expected (100%) rename {src-tranche/1_tests => tranche/test}/test14.dat.expected (100%) rename {src-tranche/1_tests => tranche/test}/test15.dat.expected (100%) rename {src-tranche/1_tests => tranche/test}/test1stdout.dat.expected (100%) create mode 100644 tranche/test/test2.c.expected create mode 100644 tranche/test/test2.h.expected create mode 100644 tranche/test/test2.trc.c rename {src-tranche/1_tests => tranche/test}/tranche (100%) diff --git a/da/makefile b/da/makefile new file mode 100644 index 0000000..67fbdb9 --- /dev/null +++ b/da/makefile @@ -0,0 +1,21 @@ +# da/makefile + +SHELL=/bin/bash +MAKE= + +-include makefile-flags + +.PHONY: all +all: version dep lib exec + +.PHONY: lib +lib: + $(MAKE) $@ + cp src/da.lib.h include/da.h + +%:: + $(MAKE) $@ + + + + diff --git a/src-da/0_makefile-flags b/da/makefile-flags similarity index 74% rename from src-da/0_makefile-flags rename to da/makefile-flags index 6860d2f..d732652 100644 --- a/src-da/0_makefile-flags +++ b/da/makefile-flags @@ -1,4 +1,6 @@ +MODULE=da + # 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 @@ -6,30 +8,26 @@ ECHO= echo # directories used by this makefile, these could all be set to dot for # the simplest source directory structure -#LIDBIR, EXECSDIR, HDIR hold the make results that might later be staged +#LIDBIR, EXECDIR, INCDIR hold the make results that might later be staged #$(PWD) is the directory that make was called from, this is already build in #set to dot to use the same directory as the source code #leave blank to ommit -DEPRDIR=1_deprecated -DOCDIR=1_doc -EXECSDIR=1_execs -INCDIR=1_include -LIBDIR=1_lib -TESTDIR=1_tests -TMPDIR=1_tmp +DEPRDIR=deprecated +DOCDIR=doc +EXECDIR=exec +INCDIR=include +LIBDIR=lib +SRCDIR=src +TESTDIR=test +TMPDIR=tmp TOOLSDIR=$(realpath $(PROJECT_SUBU)/tools) -TRYDIR=1_try +TRYDIR=try # compiler and flags C=gcc CFLAGS=-std=gnu11 -fPIC -I. -ggdb -Werror -DDEBUG -DDEBUGDB #CFLAGS=-std=gnu11 -fPIC -I. -Werror -LINKFLAGS=-L1_lib -lda - -CC= - -LIBFILE=libda.a -INCFILE=da.h +LINKFLAGS=-Llib -lda MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tools/lib/makefile_cc #MAKE=/usr/bin/make -f $(PROJECT_SUBU)/tools/lib/makefile_cc diff --git a/src-da/da.lib.c b/da/src/da.lib.c similarity index 100% rename from src-da/da.lib.c rename to da/src/da.lib.c diff --git a/src-da/da.lib.h b/da/src/da.lib.h similarity index 100% rename from src-da/da.lib.h rename to da/src/da.lib.h diff --git a/da/test/makefile b/da/test/makefile new file mode 100644 index 0000000..dbd6be0 --- /dev/null +++ b/da/test/makefile @@ -0,0 +1,15 @@ +# da/test + +SHELL=/bin/bash + +-include makefile-flags + +.PHONY: all +all: version deps lib exec + +%:: + $(MAKE) $@ + + + + diff --git a/da/test/makefile-dep b/da/test/makefile-dep new file mode 100644 index 0000000..cf61fb9 --- /dev/null +++ b/da/test/makefile-dep @@ -0,0 +1,5 @@ +./test_da.lib.o: test_da.lib.c ../include/da.h test_da.lib.h +./test_da.cli.o: test_da.cli.c test_da.lib.h + +./test_da : ./test_da.cli.o ./libtest.a + gcc -o ./test_da ./test_da.cli.o -L. -L../lib -ltest -lda diff --git a/src-da/1_tests/0_makefile-flags b/da/test/makefile-flags similarity index 77% rename from src-da/1_tests/0_makefile-flags rename to da/test/makefile-flags index 50cc00a..d916748 100644 --- a/src-da/1_tests/0_makefile-flags +++ b/da/test/makefile-flags @@ -1,4 +1,6 @@ +MODULE=test + # 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 @@ -12,22 +14,20 @@ ECHO= echo #leave blank to ommit DEPRDIR= DOCDIR= -EXECSDIR=. +EXECDIR=. INCDIR=. LIBDIR=. -TESTDIR=. -TMPDIR=1_tmp +SRCDIR=. +TESTDIR= +TMPDIR=. TOOLSDIR=$(realpath $(PROJECT_SUBU)/tools) TRYDIR= - # compiler and flags C=gcc -CFLAGS=-std=gnu11 -fPIC -I. -I../1_include -ggdb -Werror -DDEBUG -DDEBUGDB -#CFLAGS=-std=gnu11 -fPIC -I. -I../1_include -Werror -LINKFLAGS=-L. -L../1_lib -ltests -lda - -LIBFILE=libtests.a +CFLAGS=-std=gnu11 -fPIC -I../include -ggdb -Werror -DDEBUG -DDEBUGDB +#CFLAGS=-std=gnu11 -fPIC -I../include -Werror +LINKFLAGS=-L. -L../lib -ltest -lda MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tools/lib/makefile_cc #MAKE=/usr/bin/make -f $(PROJECT_SUBU)/tools/lib/makefile_cc diff --git a/src-da/1_tests/results b/da/test/results similarity index 100% rename from src-da/1_tests/results rename to da/test/results diff --git a/src-da/1_tests/test.dat b/da/test/test.dat similarity index 100% rename from src-da/1_tests/test.dat rename to da/test/test.dat diff --git a/src-da/1_tests/test_da.cli.c b/da/test/test_da.cli.c similarity index 100% rename from src-da/1_tests/test_da.cli.c rename to da/test/test_da.cli.c diff --git a/da/test/test_da.cli.o b/da/test/test_da.cli.o new file mode 100644 index 0000000000000000000000000000000000000000..d28221c2160978696ccad7d701552fb648bd71d4 GIT binary patch literal 7584 zcmbVReQX@X6`#HH-mTB}*|D7u6Ixx`1SJLE*^Wt_5Q7uAe&mm;N-0!A)sL!1baA8nu3McK0PP)Lw3Ejh_7&dhp|?G2rt$ zAJuEW^li^Ki z249@5Tn;@>h1P5Y`N%s<*FzOG;)tS6ylOI{n!#~I&{|9&zS#689YzTz9C0tvr+TWO zA>^+tM>%H9!80l><0x~F?=%^d6z;B!lcALrkU?zG2oEBi5$96`5yb*wdSHvXg@t$vh9$&Og*Cty) zh8Y_Ig_wa2tvF#AR~xPlWcvV+npqdW03z2tB6Yi1k{cXL&H)wUlP#D>I3wiQx*Wf% z6&FG4??L@l_-kkJpL5F-z{YQL=RysOa3uL&CJZ`THDS_)@1| znq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iBNh*GT{I1@vXU6QIZMjHEAbpvdFjKZ)muY2uLo3GtXiEK>g+ z>JQGFydcCJ$+Ct7)DM4s(jgw(h6u~`CjDPe&PEk|nV0Pfzk}krP2qn=yj-8s|32a^ zMPJ5OQ~0xleTBz67nZ~PSbc!VT! zeVvYe($8;6zgywoN*6Z39mA2^1@nojf-pheg%h*MLJkn+{`r2tq}*-ve!p z;@^pfPAJkI;SOtzZrhZK7` zeo22Dghu&0(I9^vpeyZVUNLsHZ}dG*{f|&1-o^0lr`qG1P+k#W;2#!rQN;NT7d2P- Rnl!RMMe&~s8-uLc{~x_m)7bz3 literal 0 HcmV?d00001 diff --git a/src-da/1_tests/test_da.lib.c b/da/test/test_da.lib.c similarity index 100% rename from src-da/1_tests/test_da.lib.c rename to da/test/test_da.lib.c diff --git a/src-da/1_tests/test_da.lib.h b/da/test/test_da.lib.h similarity index 100% rename from src-da/1_tests/test_da.lib.h rename to da/test/test_da.lib.h diff --git a/da/test/test_da.lib.o b/da/test/test_da.lib.o new file mode 100644 index 0000000000000000000000000000000000000000..2a03683de94467de6719da24d1878588bcdf1aae GIT binary patch literal 10768 zcmbVRYj9gf72fOXm9Ar3eyK^^gh4H7n-na?P6$qF7dNRA#Yvmc*3>OcZ)EAp5|JfU zx=P$fs0XKDP2~A47n&KWK*O3=B}(p|1dK5=eNQvwK#) z-bjUX$GW@Uw`b2ed(Pgyd#~?~?%Y~u7)%v|UC9=ZVi`NOYN0(Kngi?t7Gy)Q=@(*? zuMEWQjUIcv9y(&vPriixPezYo6`P43i%myQzkE^b-l3x?6`THzl9`Dfot!tOqeo+t z(bM&aPB(nyIT-T$*yQPfmQT-5MNh_NhK>s*Ykm@&J{FsNX*KkjEe}B7n@>bf8Oi|J zd->XlgQu7q2Kw|&E2!M~lk!ENDI~USq#x!Y;wLH4NM+9+whUk z0Ry3=5Wh|)=VRxF__ZgZXK=i5?#Za|6+?W6x$hA+*v9Bt5#TxLK_$0U1AJz}Ib&3H z=^NmLu3{?s>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BqA0tHZ_;>` z-!|g0^5*wa5AV(IfQR?q7q`^l$7}F29^M=0AJyPrt-+g^R4CZ()uWzV__a{2HI!3d zmyyTc&2(SkT(Bq}zoTLiA7h|ad_Bb-*8mnAPND*@5mzbieHw;6JnF)nVd;}qMgLjC zTQvR;gm-Fugp6OW@t4!QZr1oT;kd@{AU%1F$L9nVS5_5239<=|zmN2MTH|Mk$L9qW z70*-T=hr1&;Xg@uPUFP~dEkDo@pln^R^!#a_B)M#ll*x_;{)W+KQ#Us;(b&r|MAN; zmJW^ojHFpezo~SAIXH@lTWd(;EK);(w#@e<8bn)cEI#KcVrjlb(NR{C7xx ziK;;kWA|f{Tc+`k5xzv@KSsD)<6j{?8#VqJ@@KEce~b8i8b3r>*-`m@p5!0Wy@?YnjUq&UPaFx+q6-B^@ei5NRc4V@1WkLJjvUQyvhp; zmu??}FAY$;MOmj+tLS9oVb>XV8UEio&cY+55(^je5{TZUGg2P4Gr3eAWJEhYGE#K* zgBT7bsu<6W!nbTMC;rDx{a}xU6ZtXx4#UE^yz7MF8v=aMfiD#_$VuC&VtmY@S-kx! z1Vb^#-khMe0lYxbzx&g&kezVFGYu}O0r+{#5j?CxIZo>q-$ih&dOlJ&yOekm10>5m zw2l;3wQe8(Ux7N`?)YvPi#ok)2_Tyy`;Q{<6y?97u7rl}6ZZ8`Kp)lSq04Rr*=q5d zT8Ua1J3)Fde%Ms@Rs05l({%#Ho`-)PVYyoC)F9gfGCGIjLiFilEdo!`Wrv}!n*ZbP zl7rNE^dHZgy8pKUr|ZO#yUG6Fw8ZMNS&*$}|1jBCaYFkT65akm;83UX6PluIZj<%p zHS8-tra-LP_-s&)SLZK@7UrtP&(e6+uj #include -#tranche dispatch.lib.h +#tranche include/dispatch.h void dispatch_f_mess(char *fname, int err, char *dispatchee); #tranche-end void dispatch_f_mess(char *fname, int err, char *dispatchee){ @@ -76,7 +76,7 @@ void dispatch_f_mess(char *fname, int err, char *dispatchee){ //-------------------------------------------------------------------------------- // interface call point, dispatch a function -#tranche dispatch.lib.h +#tranche include/dispatch.h int dispatch_f(char *fname, int (*f)(void *arg), void *f_arg); #tranche-end int dispatch_f(char *fname, int (*f)(void *arg), void *f_arg){ @@ -99,7 +99,7 @@ int dispatch_f(char *fname, int (*f)(void *arg), void *f_arg){ //-------------------------------------------------------------------------------- // interface call point, dispatch a function with a given euid/egid // of course this will only work if our euid is root in the first place -#tranche dispatch.lib.h +#tranche include/dispatch.h int dispatch_f_euid_egid(char *fname, int (*f)(void *arg), void *f_arg, uid_t euid, gid_t egid); #tranche-end int dispatch_f_euid_egid(char *fname, int (*f)(void *arg), void *f_arg, uid_t euid, gid_t egid){ @@ -128,7 +128,7 @@ int dispatch_f_euid_egid(char *fname, int (*f)(void *arg), void *f_arg, uid_t eu //-------------------------------------------------------------------------------- // interface call point, dispatch a executable -#tranche dispatch.lib.h +#tranche include/dispatch.h int dispatch_exec(char **argv, char **envp); #tranche-end int dispatch_exec(char **argv, char **envp){ diff --git a/doc/dir-structure.txt b/doc/dir-structure.txt index 668b909..b385074 100644 --- a/doc/dir-structure.txt +++ b/doc/dir-structure.txt @@ -1,6 +1,9 @@ ~ is the project directory +-------------------------------------------------------------------------------- +most subdirectories are source modules + -------------------------------------------------------------------------------- ~/tools @@ -27,29 +30,7 @@ Typically the install target copies material in the staging area to system locations. -------------------------------------------------------------------------------- -~/src - -The prefixed numbered directories are overhead for building the src code. - -src/1_tests these are programs that typically must pass before the compiled -code may be staged. Tests typically make use of the library in 2_lib and -the header files in 2_include. - -src/1_try a free area for the programmer to try things out. For example when -learning a language. Programs and code left in this directory might be interesting -to newcomers. - -src/2_bin these are cli executables that have been created by the makefile -and will be staged after testing - -src/2_include interface header files to be released with the lib. These might -be different from the build header files found in the src dir. - -src/2_lib holds libraries being tested. Currently each src directory only -builds one library. - -3_documents these are for developers working on src. A user manual might -be under development. +~/ diff --git a/makefile b/makefile index c8d9a4e..ddad312 100755 --- a/makefile +++ b/makefile @@ -1,13 +1,15 @@ -SRCDIRS= $(wildcard src-*) -MAKEABLE=$(shell \ - find src-*\ - -mindepth 1 \ - \( -name '?_makefile' -o -name 'makefile' -o -name 'Makefile' \)\ - -printf "%h\n"\ - | grep -v deprecated | grep -v doc | sort -u | sed ':a;N;$!ba;s/\n/ /g' \ -) - -all : +#MAKEABLE=$(shell \ +# find .\ +# \( -name 'makefile' -o -name 'Makefile' \)\ +# -printf "%h\n"\ +# | grep -v deprecated | grep -v doc | sort -u | sed ':a;N;$!ba;s/\n/ /g' \ +#) + +MAKEABLE= da da/test tranche + +.PHONY: all info clean dist-clean + +all: $(foreach dir, $(MAKEABLE), \ make -C $$dir -make -C $$dir stage @@ -17,10 +19,11 @@ info: @echo "SRCDIRS:" $(SRCDIRS) @echo "MAKEABLE:" $(MAKEABLE) -clean : +clean: for dir in $(MAKEABLE); do pushd $$dir; make clean; popd; done -dist-clean : clean +dist-clean : + for dir in $(MAKEABLE); do pushd $$dir; make dist-clean; popd; done for i in $(wildcard stage/lib/*); do rm $$i; done for i in $(wildcard stage/inc/*); do rm $$i; done for i in $(wildcard stage/bin/*); do rm $$i; done diff --git a/src-da/0_makefile b/src-da/0_makefile deleted file mode 100644 index 9835402..0000000 --- a/src-da/0_makefile +++ /dev/null @@ -1,18 +0,0 @@ -# src-da/0_makefile - -SHELL=/bin/bash - --include 0_makefile-flags - -all: version deps lib execs - -lib: - $(MAKE) $@ - cp da.lib.h 1_include/da.h - -%:: - $(MAKE) $@ - - - - diff --git a/src-da/1_include/da.h b/src-da/1_include/da.h deleted file mode 100644 index 6d3c43b..0000000 --- a/src-da/1_include/da.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef DA_LIB_H -#define DA_LIB_H -#include -#include -#include - -typedef struct Da{ - char *base; - char *end; // one byte/one element off the end of the array - size_t size; // size >= (end - base) + 1; - size_t element_size; -} Da; - -#define RETURN(dap, r) \ - { da_map(dap, da_free, NULL); return r; } - -void da_alloc(Da *dap, size_t element_size); -void da_free(Da *dap); -void da_rewind(Da *dap); -char *da_expand(Da *dap); -void da_rebase(Da *dap, char *old_base, void *pta); -bool da_endq(Da *dap, void *pt); -bool da_boundq(Da *dap); -void da_push(Da *dap, void *element); -bool da_pop(Da *dap, void *element); -char *da_index(Da *dap, size_t i); -void da_map(Da *dap, void f(void *, void *), void *closure); -void da_free_elements(Da *dap); -void da_strings_puts(Da *dap); -char *da_fgets(Da *dap, FILE *fd); - -#endif - diff --git a/src-da/1_tests/0_makefile b/src-da/1_tests/0_makefile deleted file mode 100644 index 8b6f67c..0000000 --- a/src-da/1_tests/0_makefile +++ /dev/null @@ -1,14 +0,0 @@ -# src-da/1_tests/0_makefile - -SHELL=/bin/bash - --include 0_makefile-flags - -all: version deps lib execs - -%:: - $(MAKE) $@ - - - - diff --git a/src-dispatch/0_makefile b/src-dispatch/0_makefile deleted file mode 100644 index 9835402..0000000 --- a/src-dispatch/0_makefile +++ /dev/null @@ -1,18 +0,0 @@ -# src-da/0_makefile - -SHELL=/bin/bash - --include 0_makefile-flags - -all: version deps lib execs - -lib: - $(MAKE) $@ - cp da.lib.h 1_include/da.h - -%:: - $(MAKE) $@ - - - - diff --git a/src-tranche/0_makefile b/src-tranche/0_makefile deleted file mode 100644 index 107d319..0000000 --- a/src-tranche/0_makefile +++ /dev/null @@ -1,18 +0,0 @@ -# src-da/0_makefile - -SHELL=/bin/bash - --include 0_makefile-flags - -all: version deps lib execs - -lib: - $(MAKE) $@ - cp tranche.lib.h 1_include/tranche.h - -%:: - $(MAKE) $@ - - - - diff --git a/src-tranche/0_makefile-flags b/src-tranche/0_makefile-flags deleted file mode 100644 index e37767f..0000000 --- a/src-tranche/0_makefile-flags +++ /dev/null @@ -1,45 +0,0 @@ - -# 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 - -#LIDBIR, EXECSDIR, HDIR hold the make results that might later be staged -#$(PWD) is the directory that make was called from, this is already build in -#set to dot to use the same directory as the source code -#leave blank to ommit -DEPRDIR=1_deprecated -DOCDIR=1_doc -EXECSDIR=1_execs -INCDIR=1_include -LIBDIR=1_lib -TESTDIR=1_tests -TMPDIR=1_tmp -TOOLSDIR=$(realpath $(PROJECT_SUBU)/tools) -TRYDIR=1_try - -# compiler and flags -CC=gcc -CFLAGS=-std=gnu11 -fPIC -I. -I$(PROJECT_SUBU)/stage/include -ggdb -Werror -DDEBUG -DDEBUGDB -#CFLAGS=-std=gnu11 -fPIC -I. -Werror -LINKFLAGS=-L1_lib -L$(PROJECT_SUBU)/stage/lib -lda -ltranche - -LIBFILE=libtranche.a -INCFILE=tranche.h - -MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tools/lib/makefile_cc - -# files used by the compiler -SOURCES_LIB= $(wildcard *.lib.c) -SOURCES_CLI= $(wildcard *.cli.c) -SOURCES= $(SOURCES_LIB) $(SOURCES_CLI) - -HFILES = $(wildcard *.lib.h) $(wildcard *.cli.h) - -OBJECTS_LIB= $(patsubst %.c, %.o, $(SOURCES_LIB)) -OBJECTS_CLI= $(patsubst %.c, %.o, $(SOURCES_CLI)) -OBJECTS= $(OBJECTS_LIB) $(OBJECTS_CLI) - -EXECS= $(sort $(patsubst %.cli.c, %, $(wildcard *.cli.c))) diff --git a/src-tranche/1_include/tranche.h b/src-tranche/1_include/tranche.h deleted file mode 100644 index 27990a6..0000000 --- a/src-tranche/1_include/tranche.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TRANCHE_LIB_H -#define TRANCHE_LIB_H - -int tranche_send(FILE *src, Da *arg_fds); - - - -#endif diff --git a/src-tranche/1_tests/0_makefile b/src-tranche/1_tests/0_makefile deleted file mode 100644 index 8b6f67c..0000000 --- a/src-tranche/1_tests/0_makefile +++ /dev/null @@ -1,14 +0,0 @@ -# src-da/1_tests/0_makefile - -SHELL=/bin/bash - --include 0_makefile-flags - -all: version deps lib execs - -%:: - $(MAKE) $@ - - - - diff --git a/src-tranche/1_tests/0_makefile-flags b/src-tranche/1_tests/0_makefile-flags deleted file mode 100644 index c990581..0000000 --- a/src-tranche/1_tests/0_makefile-flags +++ /dev/null @@ -1,33 +0,0 @@ - -# 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 - -#LIDBIR, EXECSDIR, HDIR hold the make results that might later be staged -#$(PWD) is the directory that make was called from, this is already build in -#set to dot to use the same directory as the source code -#leave blank to ommit -DEPRDIR= -DOCDIR= -EXECSDIR=. -INCDIR=. -LIBDIR=. -TESTDIR=. -TMPDIR=1_tmp -TOOLSDIR=$(realpath $(PROJECT_SUBU)/tools) -TRYDIR= - - -# compiler and flags -CC=gcc -CFLAGS=-std=gnu11 -fPIC -I. -I../1_include -ggdb -Werror -DDEBUG -DDEBUGDB -#CFLAGS=-std=gnu11 -fPIC -I. -I../1_include -Werror -LINKFLAGS=-L. -L../1_lib -ltests -lda - -LIBFILE=libtranche.a -MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tools/lib/makefile_cc - - diff --git a/src-db/0_makefile b/subu-0/0_makefile similarity index 100% rename from src-db/0_makefile rename to subu-0/0_makefile diff --git a/src-db/0_makefile-flags b/subu-0/0_makefile-flags similarity index 100% rename from src-db/0_makefile-flags rename to subu-0/0_makefile-flags diff --git a/src-0/1_deprecated/dispatch_exec.lib.c b/subu-0/1_deprecated/dispatch_exec.lib.c similarity index 100% rename from src-0/1_deprecated/dispatch_exec.lib.c rename to subu-0/1_deprecated/dispatch_exec.lib.c diff --git a/src-0/1_deprecated/dispatch_f.lib.c b/subu-0/1_deprecated/dispatch_f.lib.c similarity index 100% rename from src-0/1_deprecated/dispatch_f.lib.c rename to subu-0/1_deprecated/dispatch_f.lib.c diff --git a/src-0/1_deprecated/dispatch_useradd.lib.c b/subu-0/1_deprecated/dispatch_useradd.lib.c similarity index 100% rename from src-0/1_deprecated/dispatch_useradd.lib.c rename to subu-0/1_deprecated/dispatch_useradd.lib.c diff --git a/src-0/1_deprecated/subu-rm-0.lib.c b/subu-0/1_deprecated/subu-rm-0.lib.c similarity index 100% rename from src-0/1_deprecated/subu-rm-0.lib.c rename to subu-0/1_deprecated/subu-rm-0.lib.c diff --git a/src-0/1_deprecated/subudb-number-next.cli.c b/subu-0/1_deprecated/subudb-number-next.cli.c similarity index 100% rename from src-0/1_deprecated/subudb-number-next.cli.c rename to subu-0/1_deprecated/subudb-number-next.cli.c diff --git a/src-0/1_doc/to_do.txt b/subu-0/1_doc/to_do.txt similarity index 100% rename from src-0/1_doc/to_do.txt rename to subu-0/1_doc/to_do.txt diff --git a/src-0/1_tests/0_makefile b/subu-0/1_tests/0_makefile similarity index 100% rename from src-0/1_tests/0_makefile rename to subu-0/1_tests/0_makefile diff --git a/src-0/1_tests/0_makefile_flags b/subu-0/1_tests/0_makefile_flags similarity index 100% rename from src-0/1_tests/0_makefile_flags rename to subu-0/1_tests/0_makefile_flags diff --git a/src-0/1_tests/1_tmp/makefile_deps b/subu-0/1_tests/1_tmp/makefile_deps similarity index 100% rename from src-0/1_tests/1_tmp/makefile_deps rename to subu-0/1_tests/1_tmp/makefile_deps diff --git a/src-0/1_tests/da.cli.c b/subu-0/1_tests/da.cli.c similarity index 100% rename from src-0/1_tests/da.cli.c rename to subu-0/1_tests/da.cli.c diff --git a/src-0/1_tests/libtests.a b/subu-0/1_tests/libtests.a similarity index 100% rename from src-0/1_tests/libtests.a rename to subu-0/1_tests/libtests.a diff --git a/src-0/1_tmp/da.lib.h b/subu-0/1_tmp/da.lib.h similarity index 100% rename from src-0/1_tmp/da.lib.h rename to subu-0/1_tmp/da.lib.h diff --git a/src-0/1_tmp/dbprintf.lib.h b/subu-0/1_tmp/dbprintf.lib.h similarity index 100% rename from src-0/1_tmp/dbprintf.lib.h rename to subu-0/1_tmp/dbprintf.lib.h diff --git a/src-0/1_tmp/dispatch.lib.h b/subu-0/1_tmp/dispatch.lib.h similarity index 100% rename from src-0/1_tmp/dispatch.lib.h rename to subu-0/1_tmp/dispatch.lib.h diff --git a/src-0/1_tmp/subu-bind-all.cli.h b/subu-0/1_tmp/subu-bind-all.cli.h similarity index 100% rename from src-0/1_tmp/subu-bind-all.cli.h rename to subu-0/1_tmp/subu-bind-all.cli.h diff --git a/src-0/1_tmp/subu-bind.cli.h b/subu-0/1_tmp/subu-bind.cli.h similarity index 100% rename from src-0/1_tmp/subu-bind.cli.h rename to subu-0/1_tmp/subu-bind.cli.h diff --git a/src-0/1_tmp/subu-common.lib.h b/subu-0/1_tmp/subu-common.lib.h similarity index 100% rename from src-0/1_tmp/subu-common.lib.h rename to subu-0/1_tmp/subu-common.lib.h diff --git a/src-0/1_tmp/subu-mk-0.cli.h b/subu-0/1_tmp/subu-mk-0.cli.h similarity index 100% rename from src-0/1_tmp/subu-mk-0.cli.h rename to subu-0/1_tmp/subu-mk-0.cli.h diff --git a/src-0/1_tmp/subu-rm-0.cli.h b/subu-0/1_tmp/subu-rm-0.cli.h similarity index 100% rename from src-0/1_tmp/subu-rm-0.cli.h rename to subu-0/1_tmp/subu-rm-0.cli.h diff --git a/src-0/1_tmp/subu.lib.h b/subu-0/1_tmp/subu.lib.h similarity index 100% rename from src-0/1_tmp/subu.lib.h rename to subu-0/1_tmp/subu.lib.h diff --git a/src-0/1_tmp/subudb-init.cli.h b/subu-0/1_tmp/subudb-init.cli.h similarity index 100% rename from src-0/1_tmp/subudb-init.cli.h rename to subu-0/1_tmp/subudb-init.cli.h diff --git a/src-0/1_tmp/subudb-number.cli.h b/subu-0/1_tmp/subudb-number.cli.h similarity index 100% rename from src-0/1_tmp/subudb-number.cli.h rename to subu-0/1_tmp/subudb-number.cli.h diff --git a/src-0/1_tmp/subudb-rel-get.cli.h b/subu-0/1_tmp/subudb-rel-get.cli.h similarity index 100% rename from src-0/1_tmp/subudb-rel-get.cli.h rename to subu-0/1_tmp/subudb-rel-get.cli.h diff --git a/src-0/1_tmp/subudb-rel-put.cli.h b/subu-0/1_tmp/subudb-rel-put.cli.h similarity index 100% rename from src-0/1_tmp/subudb-rel-put.cli.h rename to subu-0/1_tmp/subudb-rel-put.cli.h diff --git a/src-0/1_tmp/subudb-rel-rm.cli.h b/subu-0/1_tmp/subudb-rel-rm.cli.h similarity index 100% rename from src-0/1_tmp/subudb-rel-rm.cli.h rename to subu-0/1_tmp/subudb-rel-rm.cli.h diff --git a/src-0/1_tmp/subudb-subus.cli.h b/subu-0/1_tmp/subudb-subus.cli.h similarity index 100% rename from src-0/1_tmp/subudb-subus.cli.h rename to subu-0/1_tmp/subudb-subus.cli.h diff --git a/src-0/1_tmp/subudb.lib.h b/subu-0/1_tmp/subudb.lib.h similarity index 100% rename from src-0/1_tmp/subudb.lib.h rename to subu-0/1_tmp/subudb.lib.h diff --git a/src-0/1_try/split.c b/subu-0/1_try/split.c similarity index 100% rename from src-0/1_try/split.c rename to subu-0/1_try/split.c diff --git a/src-0/1_try/split_arg.c b/subu-0/1_try/split_arg.c similarity index 100% rename from src-0/1_try/split_arg.c rename to subu-0/1_try/split_arg.c diff --git a/src-0/1_try/subudb b/subu-0/1_try/subudb similarity index 100% rename from src-0/1_try/subudb rename to subu-0/1_try/subudb diff --git a/src-0/1_try/voidptr.c b/subu-0/1_try/voidptr.c similarity index 100% rename from src-0/1_try/voidptr.c rename to subu-0/1_try/voidptr.c diff --git a/src-0/common.lib.c b/subu-0/common.lib.c similarity index 100% rename from src-0/common.lib.c rename to subu-0/common.lib.c diff --git a/src-0/db.lib.c b/subu-0/db.lib.c similarity index 100% rename from src-0/db.lib.c rename to subu-0/db.lib.c diff --git a/src-0/subu-bind-all.cli.c b/subu-0/subu-bind-all.cli.c similarity index 100% rename from src-0/subu-bind-all.cli.c rename to subu-0/subu-bind-all.cli.c diff --git a/src-0/subu-bind.cli.c b/subu-0/subu-bind.cli.c similarity index 100% rename from src-0/subu-bind.cli.c rename to subu-0/subu-bind.cli.c diff --git a/src-0/subu-mk-0.cli.c b/subu-0/subu-mk-0.cli.c similarity index 100% rename from src-0/subu-mk-0.cli.c rename to subu-0/subu-mk-0.cli.c diff --git a/src-0/subu-rm-0.cli.c b/subu-0/subu-rm-0.cli.c similarity index 100% rename from src-0/subu-rm-0.cli.c rename to subu-0/subu-rm-0.cli.c diff --git a/src-0/subu.lib.c b/subu-0/subu.lib.c similarity index 100% rename from src-0/subu.lib.c rename to subu-0/subu.lib.c diff --git a/src-0/subudb-init.cli.c b/subu-0/subudb-init.cli.c similarity index 100% rename from src-0/subudb-init.cli.c rename to subu-0/subudb-init.cli.c diff --git a/src-0/subudb-number.cli.c b/subu-0/subudb-number.cli.c similarity index 100% rename from src-0/subudb-number.cli.c rename to subu-0/subudb-number.cli.c diff --git a/src-0/subudb-rel-get.cli.c b/subu-0/subudb-rel-get.cli.c similarity index 100% rename from src-0/subudb-rel-get.cli.c rename to subu-0/subudb-rel-get.cli.c diff --git a/src-0/subudb-rel-put.cli.c b/subu-0/subudb-rel-put.cli.c similarity index 100% rename from src-0/subudb-rel-put.cli.c rename to subu-0/subudb-rel-put.cli.c diff --git a/src-0/subudb-rel-rm.cli.c b/subu-0/subudb-rel-rm.cli.c similarity index 100% rename from src-0/subudb-rel-rm.cli.c rename to subu-0/subudb-rel-rm.cli.c diff --git a/src-0/subudb-subus.cli.c b/subu-0/subudb-subus.cli.c similarity index 100% rename from src-0/subudb-subus.cli.c rename to subu-0/subudb-subus.cli.c diff --git a/src-py/subu-mk.py b/subu-1/subu-mk.py similarity index 100% rename from src-py/subu-mk.py rename to subu-1/subu-mk.py diff --git a/tools/bin/make b/tools/bin/make deleted file mode 100755 index 3345aba..0000000 --- a/tools/bin/make +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -mf=( ?_makefile ) -if [ -f "$mf" ]; then - /usr/bin/make -f "$mf" "$@" -else - /usr/bin/make "$@" -fi - - - diff --git a/tools/bin/tranche b/tools/bin/tranche new file mode 100755 index 0000000000000000000000000000000000000000..eb63c284feadfc1cc45b4d401b14307666312e76 GIT binary patch literal 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q>K%x8g$F_r+&?En;q+d-cW7{E zAexFsT2?MuwQ_nP+~&mkdE*w|hmukW{31sJ_jaL3dT?+bRBV{2RFiN_v__Q^vPt+7iSm?VF*A_6mhI-_U+dN2uf4O`#B?NE=q*~BTo1mk4WBl%M=`qyK!CHS*6*%Zgm!(c!q z@C78MmQcE7P5gpSc8O3@ z+jGce_T;#E77A^@W~1ukw!OP4HB;W$e%dEf#8S2Qo1w6pMoV(vAT|~OQwa(CbPijs z(ZrC^g7>LKTiQ2lY38Pw#ISGM(v|MVZ(a3Aj22>j{Elu*WM2&SB*bpB;OxQnG{2&2 zM?&CXIu27o<%R}QMvG{UmQ-{v@|-Whi;GU*675qnWM2fj8j~7wz)KCChvD#GKQ0Wt zaoEB~izq-ELvtA|n6$Y&EBz9cX$hyW(bkntVWMw|M7z?xuojN>X3+jv53W6m)zy`V z?$Maou~QrbaGJ~A?@Hnh1FywyrKtC}jw-@The3Va*5tX!;1qzRf6^TQhVOzXeZRmm zAGq9SrNzMP`mebIg8!P*pC_=)hf{wOSa?NMT>J0!1ca~`>og|qKb8j~>2-ucjcbv? z>cjG1@4q!E{WGeql)lq{MK<;$!}eE;UEiFf`g&hi|869YWHaghrS)_>{s26RXnp;{s=U?z7YseOuo1h;1PjjKD3^OKLg9IukY(0X_GpEjH<|KJx%@v zGNft$^?l}PrSFtyS@!fc5Ym*m#nSpaEsD%&eGNUxaQ@aw?_;-dVn^crnmswXlRO7v z7f|{8SIEp^2Tzx)$xR?QY2?+dloG8t%xF(e*=0HOue?fXl{ox&>Tk%Qzx_I?-)IjG zNKXB0mA*6nab8%E{!5PXwH-n|_JxA_@T!fKQ)>RY1oX}L)BQpBYwnxqzN1tHINd8T ap60hFU9P5anw(Dm)>1 depfile +.PHONY: dep +dep: @if [ -z "$(CC)" ]; then\ if [ -z "$C()" ]; then\ echo "No compiler specified";\ exit 1;\ else\ echo "C compiler only deps" ;\ - $(C) $(CFLAGS) -MM $(C_SOURCES) 1> $(DEPSFILE);\ + $(C) $(CFLAGS) -MM $(C_SOURCE_LIB) $(C_SOURCE_CLI) | sed 's|^.*\.o|$(TMPDIR)/&|' > $(DEPFILE);\ echo "deps for C linking";\ - for i in $(EXECS) ; do\ - $(ECHO) >> $(DEPSFILE);\ - $(ECHO) "$(EXECSDIR)/$$i : $$i.cli.o $(LIBDIR)/$(LIBFILE)" >> $(DEPSFILE);\ - $(ECHO) " $(C) -o $(EXECSDIR)/$$i $$i.cli.o $(LINKFLAGS)" >> $(DEPSFILE);\ + for i in $(C_BASE_CLI) ; do\ + $(ECHO) >> $(DEPFILE);\ + $(ECHO) "$(EXECDIR)/$$i : $(TMPDIR)/$$i.cli.o $(LIBFILE)" >> $(DEPFILE);\ + $(ECHO) " $(C) -o $(EXECDIR)/$$i $(TMPDIR)/$$i.cli.o $(LINKFLAGS)" >> $(DEPFILE);\ done;\ fi;\ else\ - $(CC) $(CCFLAGS) -MM $(CC_SOURCES) 1> $(DEPSFILE);\ + $(CC) $(CCFLAGS) -MM $(CC_SOURCE_LIB) $(CC_SOURCE_CLI) | sed 's|^.*\.o|$(TMPDIR)/&|' > $(DEPFILE);\ if [ -z "$C()" ]; then\ echo "CC compiler only deps" ;\ else\ echo "CC and C mixed compile deps" ;\ - $(C) $(CFLAGS) -MM $(C_SOURCES) 1>> $(DEPSFILE);\ + $(C) $(CFLAGS) -MM $(C_SOURCE_LIB) $(C_SOURCE_CLI) | sed 's|^.*\.o|$(TMPDIR)/&|' > $(DEPFILE);\ fi;\ echo "deps for CC linking";\ - for i in $(EXECS) ; do\ - $(ECHO) >> $(DEPSFILE);\ - $(ECHO) "$(EXECSDIR)/$$i : $$i.cli.o $(LIBDIR)/$(LIBFILE)" >> $(DEPSFILE);\ - $(ECHO) " $(CC) -o $(EXECSDIR)/$$i $$i.cli.o $(LINKFLAGS)" >> $(DEPSFILE);\ + for i in $(CC_BASE_CLI) $(C_BASE_CLI) ; do\ + $(ECHO) >> $(DEPFILE);\ + $(ECHO) "$(EXECDIR)/$$i : $(TMPDIR)/$$i.cli.o $(LIBFILE)" >> $(DEPFILE);\ + $(ECHO) " $(CC) -o $(EXECDIR)/$$i $(TMPDIR)/$$i.cli.o $(LINKFLAGS)" >> $(DEPFILE);\ done;\ fi -lib: - make $(LIBDIR)/$(LIBFILE) +.PHONY: lib +lib: $(LIBFILE) -$(LIBDIR)/$(LIBFILE) : $(OBJECTS_LIB) - if [ ! -e $(DEPSFILE) ]; then make deps; fi - ar rcs $(LIBDIR)/$(LIBFILE) $(OBJECTS_LIB) +$(LIBFILE): $(OBJECT_LIB) + ar rcs $(LIBFILE) $(OBJECT_LIB) -execs: $(LIBDIR)/$(LIBFILE) - make sub_execs +.PHONY: exec +exec: $(LIBFILE) + make sub_exec -sub_execs: $(patsubst %, $(EXECSDIR)/%, $(EXECS)) +.PHONY: sub_exec +sub_exec: $(EXEC) +.PHONY: stage stage: - if [ -f $(LIBDIR)/$(LIBFILE) ]; then cp $(LIBDIR)/$(LIBFILE) $(PROJECT_SUBU)/stage/lib; fi - if [ -f $(INCDIR)/$(INCFILE) ]; then cp $(INCDIR)/$(INCFILE) $(PROJECT_SUBU)/stage/include; fi - -cp $(EXECSDIR)/* $(PROJECT_SUBU)/stage/bin + [ -f $(LIBFILE) ] && cp $(LIBFILE) $(PROJECT_SUBU)/stage/lib || true + [ -f $(INCFILE) ] && cp $(INCFILE) $(PROJECT_SUBU)/stage/include || true + [ $(shell ls -A $(EXECDIR)) ] && cp $(EXECDIR)/* $(PROJECT_SUBU)/stage/bin || true +.PHONY: clean clean: - for i in $(wildcard *~); do mv $$i $(TMPDIR); done - for i in $(wildcard *.lib.o) $(wildcard *.cli.o); do rm $$i; done - for i in $(EXECS); do if [ -e $(EXECSDIR)/$$i ]; then rm $(EXECSDIR)/$$i; fi; done - if [ -f $(LIBDIR)/$(LIBFILE) ]; then rm $(LIBDIR)/$(LIBFILE); fi - if [ -f $(DEPSFILE) ]; then rm $(DEPSFILE); fi + for i in $(wildcard tmp/*); do rm $$i || true; done + +.PHONY: dist-clean +dist-clean: clean + for i in $(EXEC); do [ -e $$i ] && rm $$i || true; done + rm $(INCFILE) || true + rm $(LIBFILE) || true --include $(DEPSFILE) +-include $(DEPFILE) -# recipe for making object files: -# -%.o : %.c - $(C) $(CFLAGS) -c $< +# recipes -%.o : %.cc - $(CC) $(CCFLAGS) -c $< +$(TMPDIR)/%.o : $(SRCDIR)/%.c + $(C) $(CFLAGS) -o $@ -c $< +$(TMPDIR)/%.o : $(SRCDIR)/%.cc + $(CC) $(CCFLAGS) -o $@ -c $< diff --git a/tools/lib/makefile_trc b/tools/lib/makefile_trc new file mode 100644 index 0000000..1edc8b3 --- /dev/null +++ b/tools/lib/makefile_trc @@ -0,0 +1,188 @@ + +# We should read the tranche sources and see what files they output, and then +# build the deps accordingly, but this makefile is more primitive approach. +# Here the programmer must have one output .c file or .cc file per input tranche +# file and it must be name .{lib,cli}.{c,cc} and the {.c,.cc} output +# tranche must be named .trc.{c,cc} + +# will re-orgnaize the directory structure .. will name the src-da .. etc. to the +# name of the module, then have a source dir inside that has only the stuff +# programmer's edit, then get rid of the numbers + +SHELL=/bin/bash + +#LIDBIR, EXECDIR, HDIR hold the make results that might later be staged +#$(PWD) is the directory that make was called from, this is already build in +#set to dot to use the same directory as the source code +#leave blank to ommit +DEPRDIR=deprecated +DOCDIR=doc +EXECDIR=exec +INCDIR=include +LIBDIR=lib +SRCDIR=src +TESTDIR=test +TMPDIR=tmp +TOOLSDIR=$(realpath $(PROJECT_SUBU)/tools) +TRYDIR=try + +LIBFILE=$(LIBDIR)/lib$(MODULE).a +INCFILE=$(MODULE).h + +# these are the sources edited by the programmer +C_SOURCE_LIB= $(wildcard $(SRCDIR)/*.lib.c) +C_SOURCE_CLI= $(wildcard $(SRCDIR)/*.cli.c) +CC_SOURCE_LIB= $(wildcard $(SRCDIR)/*.lib.cc) +CC_SOURCE_CLI= $(wildcard $(SRCDIR)/*.cli.cc) + +#remove the suffix to get base name +C_BASE_LIB= $(sort $(patsubst %.lib.c, %, $(notdir $(C_SOURCE_LIB)))) +C_BASE_CLI= $(sort $(patsubst %.cli.c, %, $(notdir $(C_SOURCE_CLI)))) +CC_BASE_LIB= $(sort $(patsubst %.lib.cc, %, $(notdir $(CC_SOURCE_LIB)))) +CC_BASE_CLI= $(sort $(patsubst %.cli.cc, %, $(notdir $(CC_SOURCE_CLI)))) + +# the progreammer must name the c and cc tranches accordingly: +C_TRC_LIB= $(patasubst %, $(TMPDIR)/%.trc.c, C_BASE_LIB) +C_TRC_CLI= $(patasubst %, $(TMPDIR)/%.trc.c, C_BASE_CLI) +CC_TRC_LIB= $(patasubst %, $(TMPDIR)/%.trc.cc, CC_BASE_LIB) +CC_TRC_CLI= $(patasubst %, $(TMPDIR)/%.trc.cc, CC_BASE_CLI) + +# two sets of object files, one for the lib, and one for the command line interface progs +OBJECT_LIB= $(patsubst %, $(TMDIR)/%.o, $(C_BASE_LIB) $(CC_BASE_LIB)) +OBJECT_CLI= $(patsubst %, $(TMDIR)/%.o, $(C_BASE_CLI) $(CC_BASE_CLI)) + +# executables are made from CLI sources +EXEC= (patsubst %, $(EXECDIR)/%, $(C_BASE_CLI) $(CC_BASE_CLI)) + +#otherwise make provides default values for these +C= +CC= + +-include makefile-flags + +DEPFILE=$(TMPDIR)/makefile_dep + +# a single space literal, for example if you wanted to subsitute commas to +# spaces: $(subst $(space),;,$(string)) we ran into this out of a need to send +# multiple separate command arguments to a shell script from one variable value +blank := +space :=$(blank) $(blank) + +all: version deps lib execs + +version: + @echo makefile version 3.0 + @echo "PWD: " $(PWD) + @echo "MAKEFILE_LIST: " $(MAKEFILE_LIST) + @echo "C: " $(C) + @echo "CFLAGS: " $(CFLAGS) + @echo "CC: " $(CC) + @echo "CCFLAGS: " $(CCFLAGS) + @echo "LINKFLAGS: " $(LINKFLAGS) + +info: + @echo "DEPDIR: " $(DEPDIR) + @echo "DOCDIR: " $(DOCDIR) + @echo "EXECSDIR: " $(EXECSDIR) + @echo "INCDIR: " $(INCDIR) + @echo "LIBDIR: " $(LIBDIR) + @echo "TESTDIR: " $(TESTDIR) + @echo "TMPDIR: " $(TMPDIR) + @echo "TOOLSDIR: " $(TOOLSDIR) + @echo "TRYDIR: " $(TRYDIR) + @echo "DEPSFILE: " $(DEPSFILE) + @echo "LIBFILE: " $(LIBFILE) + @echo "TRC_TRC: " $(TRC_TRC) + @echo "C_BASE_LIB: " $(C_BASE_LIB) + @echo "C_BASE_CLI: " $(C_BASE_CLI) + @echo "CC_BASE_LIB: " $(CC_BASE_LIB) + @echo "CC_BASE_CLI: " $(CC_BASE_CLI) + +# should be safe to run this in an already setup or partially setup directory +setup: + if [ ! -e $(DEPRDIR) ]; then mkdir $(DEPRDIR); fi + if [ ! -e $(DOCDIR) ]; then mkdir $(DOCDIR); fi + if [ ! -e $(EXECSDIR) ]; then mkdir $(EXECSDIR); fi + if [ ! -e $(INCDIR) ]; then mkdir $(INCDIR); fi + if [ ! -e $(LIBDIR) ]; then mkdir $(LIBDIR); fi + if [ ! -e $(SRCDIR) ]; then mkdir $(SRCDIR); fi + if [ ! -e $(TESTDIR) ]; then mkdir $(TESTDIR); fi + if [ ! -e $(TMPDIR) ]; then mkdir $(TMPDIR); fi + if [ ! -e $(TRYDIR) ]; then mkdir $(TRYDIR); fi + +dep: $(C_TRC_LIB) $(C_TRC_CLI) $(CC_TRC_LIB) $(CC_TRC_CLI) + if [ -z "$(CC)" ]; then\ + if [ -z "$C()" ]; then\ + echo "No compiler specified";\ + exit 1;\ + else\ + echo "C compiler only deps" ;\ + $(C) $(CFLAGS) -MM $(C_TRC_LIB) $(C_TRC_CLI) 1> $(DEPSFILE);\ + echo "deps for C linking";\ + for i in $(EXECS) ; do\ + $(ECHO) >> $(DEPSFILE);\ + $(ECHO) "$(EXECSDIR)/$$i : $$i.cli.o $(LIBDIR)/$(LIBFILE)" >> $(DEPSFILE);\ + $(ECHO) " $(C) -o $(EXECSDIR)/$$i $$i.cli.o $(LINKFLAGS)" >> $(DEPSFILE);\ + done;\ + fi;\ + else\ + $(CC) $(CCFLAGS) -MM $(CC_TRC_LIB) $(CC_TRC_CLI) 1> $(DEPSFILE);\ + if [ -z "$C()" ]; then\ + echo "CC compiler only deps" ;\ + else\ + echo "CC and C mixed compile deps" ;\ + $(C) $(CFLAGS) -MM $(C_TRC_LIB) $(C_TRC_CLI) 1>> $(DEPSFILE);\ + fi;\ + echo "deps for CC linking";\ + for i in $(EXECS) ; do\ + $(ECHO) >> $(DEPSFILE);\ + $(ECHO) "$(EXECSDIR)/$$i : $$i.cli.o $(LIBDIR)/$(LIBFILE)" >> $(DEPSFILE);\ + $(ECHO) " $(CC) -o $(EXECSDIR)/$$i $$i.cli.o $(LINKFLAGS)" >> $(DEPSFILE);\ + done;\ + fi + +lib: + make $(LIBDIR)/$(LIBFILE) + +$(LIBDIR)/$(LIBFILE) : $(OBJECTS_LIB) + ar rcs $(LIBDIR)/$(LIBFILE) $(OBJECTS_LIB) + +exec: $(LIBDIR)/$(LIBFILE) + make sub_exec + +sub_exec: $(patsubst %, $(EXECSDIR)/%, $(EXECS)) + +stage: + if [ -f $(LIBDIR)/$(LIBFILE) ]; then cp $(LIBDIR)/$(LIBFILE) $(PROJECT_SUBU)/stage/lib; fi + if [ -f $(INCDIR)/$(INCFILE) ]; then cp $(INCDIR)/$(INCFILE) $(PROJECT_SUBU)/stage/include; fi + -cp $(EXECSDIR)/* $(PROJECT_SUBU)/stage/bin + +clean: + for i in $(wildcard *~); do mv $$i $(TMPDIR); done + for i in $(wildcard *.lib.o) $(wildcard *.cli.o); do rm $$i; done + for i in $(EXECS); do if [ -e $(EXECSDIR)/$$i ]; then rm $(EXECSDIR)/$$i; fi; done + if [ -f $(LIBDIR)/$(LIBFILE) ]; then rm $(LIBDIR)/$(LIBFILE); fi + if [ -f $(DEPSFILE) ]; then rm $(DEPSFILE); fi + +-include $(DEPSFILE) + +# recipes +# +%.trc.c : %.lib.c + $(TRANCHE) $< + +%.trc.c : %.cli.c + $(TRANCHE) $< + +%.trc.cc : %.lib.cc + $(TRANCHE) $< + +%.trc.cc : %.cli.cc + $(TRANCHE) $< + +%.o : %.c + $(C) $(CFLAGS) -c $< + +%.o : %.cc + $(CC) $(CCFLAGS) -c $< + diff --git a/src-tranche/1_deprecated/0_makefile b/tranche/deprecated/0_makefile similarity index 100% rename from src-tranche/1_deprecated/0_makefile rename to tranche/deprecated/0_makefile diff --git a/src-tranche/1_deprecated/0_makefile-flags b/tranche/deprecated/0_makefile-flags similarity index 100% rename from src-tranche/1_deprecated/0_makefile-flags rename to tranche/deprecated/0_makefile-flags diff --git a/src-tranche/1_doc/todo.txt b/tranche/doc/todo.txt similarity index 100% rename from src-tranche/1_doc/todo.txt rename to tranche/doc/todo.txt diff --git a/tranche/makefile b/tranche/makefile new file mode 100644 index 0000000..4c20d5e --- /dev/null +++ b/tranche/makefile @@ -0,0 +1,22 @@ +# tranche/makefile + +SHELL=/bin/bash + +-include makefile-flags + +.PHONY: all version deps lib exec +all: version deps lib exec + +lib: + $(MAKE) $@ + cp src/tranche.lib.h include/tranche.h + +exec: + $(MAKE) $@ + +%:: + $(MAKE) $@ + + + + diff --git a/src-dispatch/0_makefile-flags b/tranche/makefile-flags similarity index 64% rename from src-dispatch/0_makefile-flags rename to tranche/makefile-flags index 6641e4a..68f6296 100644 --- a/src-dispatch/0_makefile-flags +++ b/tranche/makefile-flags @@ -1,3 +1,4 @@ +MODULE=tranche # 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 @@ -6,30 +7,25 @@ ECHO= echo # directories used by this makefile, these could all be set to dot for # the simplest source directory structure -#LIDBIR, EXECSDIR, HDIR hold the make results that might later be staged +#LIDBIR, EXECDIR, INCDIR hold the make results that might later be staged #$(PWD) is the directory that make was called from, this is already build in #set to dot to use the same directory as the source code #leave blank to ommit -DEPRDIR=1_deprecated -DOCDIR=1_doc -EXECSDIR=1_execs -INCDIR=1_include -LIBDIR=1_lib -TESTDIR=1_tests -TMPDIR=1_tmp +DEPRDIR=deprecated +DOCDIR=doc +EXECDIR=exec +INCDIR=include +LIBDIR=lib +SRCDIR=src +TESTDIR=test +TMPDIR=tmp TOOLSDIR=$(realpath $(PROJECT_SUBU)/tools) -TRYDIR=1_try +TRYDIR=try -# compiler and flags C=gcc -CFLAGS=-std=gnu11 -fPIC -I. -ggdb -Werror -DDEBUG -DDEBUGDB +CFLAGS=-std=gnu11 -fPIC -I. -I../stage/include -ggdb -Werror -DDEBUG -DDEBUGDB #CFLAGS=-std=gnu11 -fPIC -I. -Werror - -LINKFLAGS=-L1_lib -lda - -LIBFILE=libdispatch.a -INCFILE=dispatch.h +LINKFLAGS=-Llib -L../stage/lib/ -lda -ltranche MAKE=/usr/bin/make --no-print-directory -f $(PROJECT_SUBU)/tools/lib/makefile_cc #MAKE=/usr/bin/make -f $(PROJECT_SUBU)/tools/lib/makefile_cc - diff --git a/src-tranche/tranche.cli.c b/tranche/src/tranche.cli.c similarity index 100% rename from src-tranche/tranche.cli.c rename to tranche/src/tranche.cli.c diff --git a/src-tranche/tranche.lib.c b/tranche/src/tranche.lib.c similarity index 94% rename from src-tranche/tranche.lib.c rename to tranche/src/tranche.lib.c index 4679dbe..9b824d3 100644 --- a/src-tranche/tranche.lib.c +++ b/tranche/src/tranche.lib.c @@ -5,18 +5,21 @@ to implementations (definitions) in a single source file of a C/C++ programs. Splits a single source file into multiple files. Scans through the single source file looking for lines of the form: - #tranche filename ... + #tranche-begin filename ... With the # as the first non-space character on the line, and only filename following the tag. Upon finding such a line, copies all following lines into the listed files, until reaching the end marker: - #endtranche + #tranche-end A next improvement of this file would be to support variables to be passed in for the file names. As it stands, changing the file name requires editing the source file. +Files are opened for create or append, so opening to the same file will append +to the end. + */ #include @@ -77,7 +80,7 @@ static bool parse_file_list(Da *file_names, char *pt0){ static void tranche_open_fd(void *fnp, void *closure){ char *file_name = *(char **)fnp; Da *fdap = (Da *)closure; - int fd = open(file_name, O_CREAT | O_TRUNC | O_WRONLY, 0666); + int fd = open(file_name, O_WRONLY | O_APPEND | O_CREAT, 0666); if(fd == -1){ fprintf(stderr, "Could not open file %s\n", file_name); return; diff --git a/src-tranche/tranche.lib.h b/tranche/src/tranche.lib.h similarity index 100% rename from src-tranche/tranche.lib.h rename to tranche/src/tranche.lib.h diff --git a/src-tranche/1_tests/test1.dat b/tranche/test/test1.dat similarity index 100% rename from src-tranche/1_tests/test1.dat rename to tranche/test/test1.dat diff --git a/src-tranche/1_tests/test1.sh b/tranche/test/test1.sh similarity index 100% rename from src-tranche/1_tests/test1.sh rename to tranche/test/test1.sh diff --git a/src-tranche/1_tests/test11.dat.expected b/tranche/test/test11.dat.expected similarity index 100% rename from src-tranche/1_tests/test11.dat.expected rename to tranche/test/test11.dat.expected diff --git a/src-tranche/1_tests/test12.dat.expected b/tranche/test/test12.dat.expected similarity index 100% rename from src-tranche/1_tests/test12.dat.expected rename to tranche/test/test12.dat.expected diff --git a/src-tranche/1_tests/test13.dat.expected b/tranche/test/test13.dat.expected similarity index 100% rename from src-tranche/1_tests/test13.dat.expected rename to tranche/test/test13.dat.expected diff --git a/src-tranche/1_tests/test14.dat.expected b/tranche/test/test14.dat.expected similarity index 100% rename from src-tranche/1_tests/test14.dat.expected rename to tranche/test/test14.dat.expected diff --git a/src-tranche/1_tests/test15.dat.expected b/tranche/test/test15.dat.expected similarity index 100% rename from src-tranche/1_tests/test15.dat.expected rename to tranche/test/test15.dat.expected diff --git a/src-tranche/1_tests/test1stdout.dat.expected b/tranche/test/test1stdout.dat.expected similarity index 100% rename from src-tranche/1_tests/test1stdout.dat.expected rename to tranche/test/test1stdout.dat.expected diff --git a/tranche/test/test2.c.expected b/tranche/test/test2.c.expected new file mode 100644 index 0000000..a4876a1 --- /dev/null +++ b/tranche/test/test2.c.expected @@ -0,0 +1,10 @@ + + +#include "test2.h" + + +int f(int x){ + return x; +} + + diff --git a/tranche/test/test2.h.expected b/tranche/test/test2.h.expected new file mode 100644 index 0000000..fdc4d72 --- /dev/null +++ b/tranche/test/test2.h.expected @@ -0,0 +1,4 @@ +#ifndef TEST2_H +#define TEST2_H +int f(int x); +#endif diff --git a/tranche/test/test2.trc.c b/tranche/test/test2.trc.c new file mode 100644 index 0000000..ff7d696 --- /dev/null +++ b/tranche/test/test2.trc.c @@ -0,0 +1,23 @@ + +#tranche test2.c + +#tranche test2.h +#ifndef TEST2_H +#define TEST2_H +#tranche-end + +#include "test2.h" + +#tranche test2.h +int f(int x); +#tranche-end + +int f(int x){ + return x; +} + +#tranche test2.h +#endif +#tranche-end + +#tranche-end diff --git a/src-tranche/1_tests/tranche b/tranche/test/tranche similarity index 100% rename from src-tranche/1_tests/tranche rename to tranche/test/tranche -- 2.20.1