citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit e6067998a3bdc9409b21acac770ea4dc946ae13f
parent 24c524df581cbdcdc0591966910c2807df0f69cf
Author: Kyle Milz <kyle@0x30.net>
Date:   Sun, 10 Jul 2016 20:36:00 -0600

src: move symlink generation here

Diffstat:
MJamfile | 1-
MJamrules | 2+-
MTest/Project.pm | 2+-
Dshare/Jamfile | 25-------------------------
Dshare/cc | 2--
Dshare/gcc | 2--
Msrc/Jamfile | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------
7 files changed, 58 insertions(+), 48 deletions(-)

diff --git a/Jamfile b/Jamfile @@ -2,5 +2,4 @@ SubDir TOP ; SubInclude TOP lib ; SubInclude TOP man ; -SubInclude TOP share ; SubInclude TOP src ; diff --git a/Jamrules b/Jamrules @@ -7,7 +7,7 @@ else { # No PREFIX means an in tree build. Use absolute paths to local copies. PWD = `pwd` ; CITRUN_LIB = $(PWD)/lib/libcitrun.a ; - CITRUN_PATH = $(PWD)/share ; + CITRUN_PATH = $(PWD)/src ; } # Packaging systems like for build systems to respect this. diff --git a/Test/Project.pm b/Test/Project.pm @@ -50,7 +50,7 @@ EOF close( $jamfile_fh ); # Use the tools in this source tree - $ENV{PATH} = cwd . "/share:$ENV{PATH}"; + $ENV{PATH} = cwd . "/src:$ENV{PATH}"; my $ret = system( "cd $tmp_dir && jam" ); die "make failed: $ret\n" if ($ret); diff --git a/share/Jamfile b/share/Jamfile @@ -1,25 +0,0 @@ -SubDir TOP share ; - -rule InstallCompilerSyms { - Depends install : $(1) ; -} - -actions InstallCompilerSyms -{ - mkdir -p $(PREFIX)/share/citrun - ln -s ../../bin/citrun-inst $(PREFIX)/share/citrun/cc - ln -s ../../bin/citrun-inst $(PREFIX)/share/citrun/gcc - ln -s ../../bin/citrun-inst $(PREFIX)/share/citrun/egcc - ln -s ../../bin/citrun-inst $(PREFIX)/share/citrun/clang - ln -s ../../bin/citrun-inst $(PREFIX)/share/citrun/c++ - ln -s ../../bin/citrun-inst $(PREFIX)/share/citrun/g++ - ln -s ../../bin/citrun-inst $(PREFIX)/share/citrun/eg++ - ln -s ../../bin/citrun-inst $(PREFIX)/share/citrun/clang++ -} - -# These are used for in-tree testing -#SoftLink $(TOP)/share/cc : $(PREFIX)/src/citrun-inst ; -#SoftLink $(TOP)/share/gcc : $(PREFIX)/src/citrun-inst ; - -# This is a completely different set generated at install time -InstallCompilerSyms $(PREFIX)/share/citrun : cc gcc ; diff --git a/share/cc b/share/cc @@ -1 +0,0 @@ -../src/citrun-inst -\ No newline at end of file diff --git a/share/gcc b/share/gcc @@ -1 +0,0 @@ -../src/citrun-inst -\ No newline at end of file diff --git a/src/Jamfile b/src/Jamfile @@ -1,9 +1,12 @@ SubDir TOP src ; +# +# citrun-wrap +# rule MkWrap { Depends $(1) : $(2) ; - Depends all : $(1) ; + Depends exe : $(1) ; Clean clean : $(1) ; } @@ -13,13 +16,14 @@ actions MkWrap chmod 755 $(1) ; } -MkWrap $(TOP)/src/citrun-wrap : $(TOP)/src/wrap.in ; - -INST_SRCS = - inst_main.cc - inst_action.cc - inst_ast_visitor.cc ; +LOCATE on citrun-wrap = $(LOCATE_TARGET) ; +SEARCH on wrap.in = $(SEARCH_SOURCE) ; +MkWrap citrun-wrap : wrap.in ; +InstallShell $(PREFIX)/bin : citrun-wrap ; +# +# citrun-gl +# GL_SRCS = gl_main.cc gl_runtime_conn.cc @@ -33,23 +37,59 @@ GL_SRCS = matrix4x4.c trackball.c ; -ObjectC++Flags $(INST_SRCS) : `llvm-config --cxxflags` ; - ObjectC++Flags $(GL_SRCS) : -std=c++11 ; ObjectC++Flags $(GL_SRCS) : `pkg-config $(PKG_CONFIG_LIBS) --cflags` ; -LINKFLAGS on citrun-inst = `llvm-config --ldflags` ; +LINKLIBS on citrun-gl += `pkg-config $(PKG_CONFIG_LIBS) --libs` ; +LinkLibraries citrun-gl : libglyphy ; + +Main citrun-gl : $(GL_SRCS) ; +InstallBin $(PREFIX)/bin : citrun-gl ; + +# +# citrun-inst +# +INST_SRCS = + inst_main.cc + inst_action.cc + inst_ast_visitor.cc ; + +ObjectC++Flags $(INST_SRCS) : `llvm-config --cxxflags` ; +LINKFLAGS on citrun-inst = `llvm-config --ldflags` ; LLVM_LIBS = bitreader mcparser transformutils option ; LINKLIBS on citrun-inst += `llvm-config --libs $(LLVM_LIBS) --system-libs` ; -LINKLIBS on citrun-gl += `pkg-config $(PKG_CONFIG_LIBS) --libs` ; - -LinkLibraries citrun-gl : libglyphy ; Main citrun-inst : $(INST_SRCS) ; -Main citrun-gl : $(GL_SRCS) ; +InstallBin $(PREFIX)/share/citrun : citrun-inst ; -InstallShell $(PREFIX)/bin : citrun-wrap ; -InstallBin $(PREFIX)/bin : citrun-inst citrun-gl ; +# Compiler symlinks +COMPILERS = cc gcc clang clang++ g++ c++ egcc eg++ ; +LOCATE on $(COMPILERS) = $(LOCATE_TARGET) ; + +rule InstLink +{ + Depends files : $(<) ; + Depends $(<) : $(>) ; + Clean clean : $(<) ; +} + +actions InstLink +{ + $(RM) $(<) && $(LN) -s citrun-inst $(<) ; +} + +InstLink cc : citrun-inst ; +InstLink gcc : citrun-inst ; +InstLink clang : citrun-inst ; +InstLink clang++ : citrun-inst ; +InstLink g++ : citrun-inst ; +InstLink c++ : citrun-inst ; +InstLink egcc : citrun-inst ; +InstLink eg++ : citrun-inst ; + +CP = cp -PR ; +FILEMODE = 755 ; +InstallInto $(PREFIX)/share/citrun : $(COMPILERS) ; SubInclude TOP src glyphy ;