commit ca0a4f1e3de84fe4862bfb91856c1c31e0b2b3c1
parent ed43b4d76addb9a1d1dfb239e637afe70a6666dd
Author: kyle <kyle@0x30.net>
Date: Sun, 29 Jan 2017 10:31:12 -0700
jam: split apart main Jamfile into lib, share, bin components
Diffstat:
5 files changed, 146 insertions(+), 119 deletions(-)
diff --git a/Jamfile b/Jamfile
@@ -1,121 +1,6 @@
SubDir TOP ;
-include Jamrules.extra ;
-
-#
-# libcitrun
-#
-if $(NT) {
- Library libcitrun : lib.c lib_win32.c ;
-} else {
- ObjectCcFlags lib.c lib_unix.c : -fPIC -ansi ;
- Library libcitrun : lib.c lib_unix.c ;
-}
-
-#
-# citrun_check
-#
-if $(NT) {
- File citrun_wrap.bat : wrap.bat ;
- Clean clean : citrun_wrap.bat ;
-}
-else {
- Shell citrun_check : check.sh ;
-}
-
-#
-# citrun_gl, citrun_gltest
-#
-GL_SRCS =
- gl_procfile.cc
- gl_transunit.cc
- process_dir.cc
- gl_view.cc
- demo-atlas.cc
- gl_buffer.cc
- gl_font.cc
- demo-glstate.cc
- demo-shader.cc
- matrix4x4.c ;
-
-Library gl_common : $(GL_SRCS) ;
-
-Stringize demo_atlas_glsl.h : demo_atlas.glsl ;
-Stringize demo_vshader_glsl.h : demo_vshader.glsl ;
-Stringize demo_fshader_glsl.h : demo_fshader.glsl ;
-
-ObjectC++Flags gl_main.cc gltest.cc $(GL_SRCS) : $(GL_CFLAGS) ;
-
-LINKLIBS on citrun_gl citrun_gltest += -lm $(GL_LIBS) ;
-LinkLibraries citrun_gl citrun_gltest : gl_common libglyphy ;
-
-Main citrun_gl : gl_main.cc ;
-
-LINKLIBS on citrun_gltest += $(GLTEST_LIBS) ;
-Main citrun_gltest : gltest.cc ;
-
-#
-# citrun_inst
-#
-INST_SRCS =
- inst_main.cc
- inst_fe.cc
- inst_action.cc
- inst_visitor.cc ;
-
-if $(NT) {
- INST_SRCS += inst_fewin32.cc ;
-} else {
- INST_SRCS += inst_feunix.cc ;
-}
-
-Stringize lib_h.h : lib.h ;
-
-ObjectC++Flags $(INST_SRCS) : $(INST_CFLAGS) ;
-
-LINKFLAGS on citrun_inst$(SUFEXE) = $(LINKFLAGS) $(INST_LDFLAGS) ;
-LINKLIBS on citrun_inst$(SUFEXE) += $(INST_LIBS) ;
-
-Main citrun_inst : $(INST_SRCS) ;
-
-if $(NT) {
- for i in cl.exe link.exe {
- MakeLocate $(i) : compilers ;
- File $(i) : citrun_inst.exe ;
- Clean clean : $(i) ;
- }
-}
-
-# Link with the c++ compiler so that the matching c++ runtime library gets added
-# automatically.
-LINK on citrun_inst citrun_gl citrun_gltest = $(C++) ;
-
-
-# Create installation directories and setup quirky ../../citrun_inst links.
-rule InstallSyms
-{
- Depends install : $(PREFIX)/share/citrun/$(>) ;
- MakeLocate $(PREFIX)/share/citrun/$(>) : $(<) ;
-
- for i in $(>)
- {
- SymLink $(PREFIX)/share/citrun/$(i) ;
- }
-}
-
-# Used by InstallSyms
-actions SymLink
-{
- $(RM) $(<) && $(LN) -s ../../bin/citrun_inst $(<) ;
-}
-
-#
-# install
-#
-InstallLib $(PREFIX)/lib : libcitrun.a ;
-InstallShell $(PREFIX)/bin : citrun_check ;
-InstallBin $(PREFIX)/bin : citrun_wrap citrun_gl citrun_inst ;
-InstallSyms $(PREFIX)/share/citrun : cc gcc clang clang++ g++ c++ egcc eg++ ;
-InstallMan $(PREFIX)/man : citrun_gl.1 citrun_inst.1 citrun_wrap.1 citrun_check.1 ;
-
-SubInclude TOP glyphy ;
+SubInclude TOP bin ;
+SubInclude TOP lib ;
+SubInclude TOP man ;
+SubInclude TOP share citrun ;
diff --git a/bin/Jamfile b/bin/Jamfile
@@ -0,0 +1,104 @@
+SubDir TOP bin ;
+SubDirHdrs $(TOP) lib ;
+
+if ! $(PREFIX) {
+ PREFIX = `pwd` ;
+}
+
+actions ShellReplace {
+ sed -e "s, PREFIX ,$(PREFIX)," < $(>) > $(<)
+ chmod +x $(<)
+}
+
+#
+# citrun_check
+# citrun_wrap
+#
+if $(NT) {
+ File citrun_wrap.bat : wrap.bat ;
+ Clean clean : citrun_wrap.bat ;
+}
+else {
+ MakeLocate citrun_check : bin ;
+ Shell citrun_check : check.sh ;
+
+ MakeLocate citrun_wrap : bin ;
+ Depends all : citrun_wrap ;
+ Clean clean : citrun_wrap ;
+ ShellReplace citrun_wrap : wrap.sh ;
+}
+
+#
+# citrun_inst
+#
+INST_SRCS =
+ inst_main.cc
+ inst_fe.cc
+ inst_action.cc
+ inst_visitor.cc ;
+
+if $(NT) {
+ INST_SRCS += inst_fewin32.cc ;
+} else {
+ INST_SRCS += inst_feunix.cc ;
+}
+
+Stringize lib_h.h : lib.h ;
+
+ObjectC++Flags $(INST_SRCS) : $(INST_CFLAGS) -DPREFIX=\\\"$(PREFIX)\\\" ;
+
+LINKFLAGS on citrun_inst$(SUFEXE) = $(LINKFLAGS) $(INST_LDFLAGS) ;
+LINKLIBS on citrun_inst$(SUFEXE) += $(INST_LIBS) ;
+
+Main citrun_inst : $(INST_SRCS) ;
+
+if $(NT) {
+ for i in cl.exe link.exe {
+ MakeLocate $(i) : compilers ;
+ File $(i) : citrun_inst.exe ;
+ Clean clean : $(i) ;
+ }
+}
+
+#
+# citrun_gl, citrun_gltest
+#
+GL_SRCS =
+ gl_procfile.cc
+ gl_transunit.cc
+ process_dir.cc
+ gl_view.cc
+ demo-atlas.cc
+ gl_buffer.cc
+ gl_font.cc
+ demo-glstate.cc
+ demo-shader.cc
+ matrix4x4.c ;
+
+Library gl_common : $(GL_SRCS) ;
+
+Stringize demo_atlas_glsl.h : demo_atlas.glsl ;
+Stringize demo_vshader_glsl.h : demo_vshader.glsl ;
+Stringize demo_fshader_glsl.h : demo_fshader.glsl ;
+
+ObjectC++Flags gl_main.cc gltest.cc $(GL_SRCS) : $(GL_CFLAGS) ;
+
+LINKLIBS on citrun_gl citrun_gltest += -lm $(GL_LIBS) ;
+LinkLibraries citrun_gl citrun_gltest : gl_common libglyphy ;
+
+Main citrun_gl : gl_main.cc ;
+
+LINKLIBS on citrun_gltest += $(GLTEST_LIBS) ;
+Main citrun_gltest : gltest.cc ;
+
+# Link with the c++ compiler so that the matching c++ runtime library gets added
+# automatically.
+LINK on citrun_inst citrun_gl citrun_gltest = $(C++) ;
+
+#
+# install
+#
+InstallShell $(PREFIX)/bin : citrun_check citrun_wrap ;
+InstallBin $(PREFIX)/bin : citrun_gl citrun_inst ;
+
+SubInclude TOP bin glyphy ;
diff --git a/lib/Jamfile b/lib/Jamfile
@@ -0,0 +1,10 @@
+SubDir TOP lib ;
+
+if $(NT) {
+ Library libcitrun : lib.c lib_win32.c ;
+} else {
+ ObjectCcFlags lib.c lib_unix.c : -fPIC -ansi ;
+ Library libcitrun : lib.c lib_unix.c ;
+
+ InstallLib $(PREFIX)/lib : libcitrun.a ;
+}
diff --git a/man/Jamfile b/man/Jamfile
@@ -0,0 +1,8 @@
+SubDir TOP man ;
+
+InstallMan $(PREFIX)/man :
+ citrun_gl.1
+ citrun_inst.1
+ citrun_wrap.1
+ citrun_check.1
+ ;
diff --git a/share/citrun/Jamfile b/share/citrun/Jamfile
@@ -0,0 +1,20 @@
+SubDir TOP share citrun ;
+
+rule InstallSym
+{
+ Depends install : $(PREFIX)/share/citrun/$(>) ;
+ MakeLocate $(PREFIX)/share/citrun/$(>) : $(<) ;
+
+ #for i in $(>)
+ #{
+ # SymLink $(PREFIX)/share/citrun/$(i) ;
+ #}
+}
+
+actions InstallSym
+{
+ cp -RP share/citrun/$(>) $(PREFIX)/share/citrun ;
+ # $(RM) $(<) && $(LN) -s ../../bin/citrun_inst $(<) ;
+}
+
+InstallSym $(PREFIX)/share/citrun : cc gcc clang clang++ g++ c++ egcc eg++ ;