citrun

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

commit 372501bd5b6a48c43dbc352b3136559128f09996
parent a377331d10e8e2abd59b276c07a29589abe2eba6
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Fri, 11 Mar 2016 02:20:16 -0700

switch Makefiles over to bsd.*.mk infrastructure

Diffstat:
MMakefile | 22+++-------------------
MSCV/Project.pm | 4++--
Minstrument/Makefile | 26++++++++------------------
Alib/Makefile | 7+++++++
Rruntime/runtime.c -> lib/runtime.c | 0
Alib/shlib_version | 2++
Druntime/Makefile | 17-----------------
Mviewer/Makefile | 23++++++-----------------
8 files changed, 28 insertions(+), 73 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,22 +1,6 @@ -.ifdef SCV_PATH -error_SCV_PATH -.endif +SUBDIR= bin instrument include lib viewer -# execvis - -SUBDIRS = instrument runtime viewer - -all: make_subdirs - -test: make_subdirs +test: prove -clean: - make -C instrument clean - make -C runtime clean - make -C viewer clean - -make_subdirs: - make -C instrument - make -C runtime - make -C viewer +.include <bsd.subdir.mk> diff --git a/SCV/Project.pm b/SCV/Project.pm @@ -55,8 +55,8 @@ EOF # Link in the runtime $ENV{CFLAGS} = "-pthread -I/home/kyle/src/scv/include"; - $ENV{LDLIBS} = "-L/home/kyle/src/scv/runtime -lruntime -pthread"; - $ENV{LD_LIBRARY_PATH} = "runtime"; + $ENV{LDLIBS} = "-L/home/kyle/src/scv/lib -lscv -pthread"; + $ENV{LD_LIBRARY_PATH} = "lib"; my $ret = system( "make -C $tmp_dir" ); die "make failed: $ret\n" if ($ret); diff --git a/instrument/Makefile b/instrument/Makefile @@ -1,6 +1,5 @@ -.ifdef SCV_PATH -error_SCV_PATH -.endif +PROG = scv_instrument +SRCS = main.cpp instrumenter.cpp CXXFLAGS += -I/usr/local/include CXXFLAGS += -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS @@ -8,9 +7,11 @@ CXXFLAGS += -fno-rtti -Wall # CXXFLAGS += -ggdb -DDEBUG CXX = eg++ -std=c++11 -# clang has a circular dependencies here, use "linker group options" to avoid -LDLIBS += \ - -Wl,--start-group \ +# OpenBSD has it's third part libraries here +LDFLAGS += -L/usr/local/lib + +# Clang has a circular dependencies here, use "linker group options" to avoid +LDADD += -Wl,--start-group \ -lclangAST \ -lclangAnalysis \ -lclangBasic \ @@ -35,15 +36,4 @@ LDLIBS += \ -lLLVMSupport \ -lpthread -lz -BIN = instrument -SRCS = main.cpp instrumenter.cpp -OBJS = $(SRCS:cpp=o) - -$(BIN): $(OBJS) - $(CXX) -o $(BIN) -L/usr/local/lib $(OBJS) $(LDLIBS) - -clean: - rm -f $(BIN) $(OBJS) - -depend: - mkdep $(CXXFLAGS) $(SRCS) +.include <bsd.prog.mk> diff --git a/lib/Makefile b/lib/Makefile @@ -0,0 +1,7 @@ +LIB = scv +SRCS = runtime.c + +CFLAGS += -pthread -I../include + +NOPROFILE = 1 +.include <bsd.lib.mk> diff --git a/runtime/runtime.c b/lib/runtime.c diff --git a/lib/shlib_version b/lib/shlib_version @@ -0,0 +1,2 @@ +major=0 +minor=0 diff --git a/runtime/Makefile b/runtime/Makefile @@ -1,17 +0,0 @@ -.ifdef SCV_PATH -error_SCV_PATH -.endif - -CFLAGS += -fPIC -pthread -I../include -LIB = libruntime.so -SRCS = runtime.c -OBJS = $(SRCS:c=o) - -$(LIB): $(OBJS) - $(CC) $(CFLAGS) -shared -o $(LIB) $(OBJS) - -clean: - rm -f $(OBJS) $(LIB) - -depend: - mkdep $(CFLAGS) $(SRCS) diff --git a/viewer/Makefile b/viewer/Makefile @@ -1,24 +1,13 @@ -.ifdef SCV_PATH -error_SCV_PATH -.endif +PROG = scv_viewer +SRCS = viewer.cpp shader_utils.cpp text.cpp af_unix.cpp +CXX = eg++ -std=c++1y CXXFLAGS += -I/usr/X11R6/include CXXFLAGS += -I/usr/X11R6/include/freetype2 CXXFLAGS += -I/usr/X11R6/include/libdrm CXXFLAGS += -I/usr/local/include -LDLIBS += -L/usr/local/lib -L/usr/X11R6/lib -lGL -lGLU -lGLEW -LDLIBS += -lfreetype -lz -lglut -CXX = eg++ -std=c++1y - -BIN = viewer -SRCS = viewer.cpp shader_utils.cpp text.cpp af_unix.cpp -OBJS = $(SRCS:cpp=o) - -$(BIN): $(OBJS) - $(CXX) -o $(BIN) $(LDLIBS) $(OBJS) -clean: - rm -f $(OBJS) $(BIN) +LDFLAGS += -L/usr/local/lib -L/usr/X11R6/lib +LDADD += -lGL -lGLU -lGLEW -lfreetype -lz -lglut -depend: - mkdep $(CXXFLAGS) $(SRCS) +.include <bsd.prog.mk>