From: Leandro Lucarella Date: Fri, 29 Oct 2010 18:17:09 +0000 (-0300) Subject: Move the example to its own subdirectory X-Git-Url: https://git.llucax.com/software/makeit.git/commitdiff_plain/516cf4c727d0e4844d65a07d14d7a96c036f44cc?ds=sidebyside Move the example to its own subdirectory --- 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