From 516cf4c727d0e4844d65a07d14d7a96c036f44cc Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 29 Oct 2010 15:17:09 -0300 Subject: [PATCH] Move the example to its own subdirectory --- .gitignore | 2 +- Makefile | 13 ++++++------- Build.mak => example/Build.mak | 10 +++++----- Config.mak => example/Config.mak | 0 {subproj => example}/Makefile | 0 {subproj => example}/Makeit.mak | 0 README => example/README | 0 example/Toplevel.mak | 1 + {lib1 => example/lib1}/Build.mak | 0 {lib1 => example/lib1}/Makefile | 0 {lib1 => example/lib1}/lib1.c | 0 {lib1 => example/lib1}/lib1.h | 0 {lib2 => example/lib2}/Build.mak | 0 {lib2 => example/lib2}/Makefile | 0 {lib2 => example/lib2}/lib2.cpp | 0 {lib2 => example/lib2}/lib2.h | 0 {prog => example/prog}/Build.mak | 0 {prog => example/prog}/Makefile | 0 {prog => example/prog}/main.cpp | 0 {subproj => example/subproj}/Build.mak | 0 {subproj => example/subproj}/Config.mak | 0 {subproj => example/subproj}/Doxyfile | 0 example/subproj/Makefile | 10 ++++++++++ example/subproj/Makeit.mak | 1 + example/subproj/Toplevel.mak | 1 + {subproj => example/subproj}/otherproj.c | 0 {subproj => example/subproj}/otherproj.h | 0 {subproj => example/subproj}/pkg-config/Build.mak | 0 .../subproj}/pkg-config/otherproj.pc.in | 0 subproj/Toplevel.mak | 13 ------------- 30 files changed, 25 insertions(+), 26 deletions(-) rename Build.mak => example/Build.mak (80%) rename Config.mak => example/Config.mak (100%) rename {subproj => example}/Makefile (100%) rename {subproj => example}/Makeit.mak (100%) rename README => example/README (100%) create mode 120000 example/Toplevel.mak rename {lib1 => example/lib1}/Build.mak (100%) rename {lib1 => example/lib1}/Makefile (100%) rename {lib1 => example/lib1}/lib1.c (100%) rename {lib1 => example/lib1}/lib1.h (100%) rename {lib2 => example/lib2}/Build.mak (100%) rename {lib2 => example/lib2}/Makefile (100%) rename {lib2 => example/lib2}/lib2.cpp (100%) rename {lib2 => example/lib2}/lib2.h (100%) rename {prog => example/prog}/Build.mak (100%) rename {prog => example/prog}/Makefile (100%) rename {prog => example/prog}/main.cpp (100%) rename {subproj => example/subproj}/Build.mak (100%) rename {subproj => example/subproj}/Config.mak (100%) rename {subproj => example/subproj}/Doxyfile (100%) create mode 100644 example/subproj/Makefile create mode 120000 example/subproj/Makeit.mak create mode 120000 example/subproj/Toplevel.mak rename {subproj => example/subproj}/otherproj.c (100%) rename {subproj => example/subproj}/otherproj.h (100%) rename {subproj => example/subproj}/pkg-config/Build.mak (100%) rename {subproj => example/subproj}/pkg-config/otherproj.pc.in (100%) delete mode 100644 subproj/Toplevel.mak diff --git a/.gitignore b/.gitignore index 567609b..614dbcf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -build/ +example/build/ diff --git a/Makefile b/Makefile index f78a4f0..f16419c 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,9 @@ -# Top-level directory -T := . +.PHONY: example +example: + @$(MAKE) -C example -# Default goal for building this directory -.DEFAULT_GOAL := all - -# Include the top-level makefile -include $T/Toplevel.mak +.PHONY: clean-example +clean-example: + @$(MAKE) -C example clean diff --git a/Build.mak b/example/Build.mak similarity index 80% rename from Build.mak rename to example/Build.mak index e167580..c40fd01 100644 --- a/Build.mak +++ b/example/Build.mak @@ -7,10 +7,10 @@ $I/include/makeit/%.h: $T/%.h $(call install_file) # Include sub-directories makefiles -$(call include_subdirs, - subproj - lib1 - lib2 - prog +$(call include_subdirs, \ + subproj \ + lib1 \ + lib2 \ + prog \ ) diff --git a/Config.mak b/example/Config.mak similarity index 100% rename from Config.mak rename to example/Config.mak diff --git a/subproj/Makefile b/example/Makefile similarity index 100% rename from subproj/Makefile rename to example/Makefile diff --git a/subproj/Makeit.mak b/example/Makeit.mak similarity index 100% rename from subproj/Makeit.mak rename to example/Makeit.mak diff --git a/README b/example/README similarity index 100% rename from README rename to example/README diff --git a/example/Toplevel.mak b/example/Toplevel.mak new file mode 120000 index 0000000..5c1ec8f --- /dev/null +++ b/example/Toplevel.mak @@ -0,0 +1 @@ +../Toplevel.mak \ No newline at end of file diff --git a/lib1/Build.mak b/example/lib1/Build.mak similarity index 100% rename from lib1/Build.mak rename to example/lib1/Build.mak diff --git a/lib1/Makefile b/example/lib1/Makefile similarity index 100% rename from lib1/Makefile rename to example/lib1/Makefile diff --git a/lib1/lib1.c b/example/lib1/lib1.c similarity index 100% rename from lib1/lib1.c rename to example/lib1/lib1.c diff --git a/lib1/lib1.h b/example/lib1/lib1.h similarity index 100% rename from lib1/lib1.h rename to example/lib1/lib1.h diff --git a/lib2/Build.mak b/example/lib2/Build.mak similarity index 100% rename from lib2/Build.mak rename to example/lib2/Build.mak diff --git a/lib2/Makefile b/example/lib2/Makefile similarity index 100% rename from lib2/Makefile rename to example/lib2/Makefile diff --git a/lib2/lib2.cpp b/example/lib2/lib2.cpp similarity index 100% rename from lib2/lib2.cpp rename to example/lib2/lib2.cpp diff --git a/lib2/lib2.h b/example/lib2/lib2.h similarity index 100% rename from lib2/lib2.h rename to example/lib2/lib2.h diff --git a/prog/Build.mak b/example/prog/Build.mak similarity index 100% rename from prog/Build.mak rename to example/prog/Build.mak diff --git a/prog/Makefile b/example/prog/Makefile similarity index 100% rename from prog/Makefile rename to example/prog/Makefile diff --git a/prog/main.cpp b/example/prog/main.cpp similarity index 100% rename from prog/main.cpp rename to example/prog/main.cpp diff --git a/subproj/Build.mak b/example/subproj/Build.mak similarity index 100% rename from subproj/Build.mak rename to example/subproj/Build.mak diff --git a/subproj/Config.mak b/example/subproj/Config.mak similarity index 100% rename from subproj/Config.mak rename to example/subproj/Config.mak diff --git a/subproj/Doxyfile b/example/subproj/Doxyfile similarity index 100% rename from subproj/Doxyfile rename to example/subproj/Doxyfile diff --git a/example/subproj/Makefile b/example/subproj/Makefile new file mode 100644 index 0000000..f78a4f0 --- /dev/null +++ b/example/subproj/Makefile @@ -0,0 +1,10 @@ + +# Top-level directory +T := . + +# Default goal for building this directory +.DEFAULT_GOAL := all + +# Include the top-level makefile +include $T/Toplevel.mak + diff --git a/example/subproj/Makeit.mak b/example/subproj/Makeit.mak new file mode 120000 index 0000000..901b31e --- /dev/null +++ b/example/subproj/Makeit.mak @@ -0,0 +1 @@ +../Makeit.mak \ No newline at end of file diff --git a/example/subproj/Toplevel.mak b/example/subproj/Toplevel.mak new file mode 120000 index 0000000..5c1ec8f --- /dev/null +++ b/example/subproj/Toplevel.mak @@ -0,0 +1 @@ +../Toplevel.mak \ No newline at end of file diff --git a/subproj/otherproj.c b/example/subproj/otherproj.c similarity index 100% rename from subproj/otherproj.c rename to example/subproj/otherproj.c diff --git a/subproj/otherproj.h b/example/subproj/otherproj.h similarity index 100% rename from subproj/otherproj.h rename to example/subproj/otherproj.h diff --git a/subproj/pkg-config/Build.mak b/example/subproj/pkg-config/Build.mak similarity index 100% rename from subproj/pkg-config/Build.mak rename to example/subproj/pkg-config/Build.mak diff --git a/subproj/pkg-config/otherproj.pc.in b/example/subproj/pkg-config/otherproj.pc.in similarity index 100% rename from subproj/pkg-config/otherproj.pc.in rename to example/subproj/pkg-config/otherproj.pc.in diff --git a/subproj/Toplevel.mak b/subproj/Toplevel.mak deleted file mode 100644 index 8cffea4..0000000 --- a/subproj/Toplevel.mak +++ /dev/null @@ -1,13 +0,0 @@ -ifndef Toplevel.mak.included -Toplevel.mak.included := 1 - -# Load top-level directory local configuration -sinclude $T/Config.mak - -# Include the build system library -include $T/Makeit.mak - -# Include the Build.mak for this directory -include $T/Build.mak - -endif -- 2.43.0