From 7b13964c390bddb35ee3579e6fe74a2de9a6baf3 Mon Sep 17 00:00:00 2001 From: Matthew Bloch Date: Sun, 7 Oct 2012 02:09:34 +0100 Subject: [PATCH] Update Rakefile to support locally-installed libcheck, removed efence, pushed -l arguments to end of link command line. --- Rakefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index 267fb55..588d284 100644 --- a/Rakefile +++ b/Rakefile @@ -24,13 +24,16 @@ CCFLAGS = %w( -Wno-missing-field-initializers ) + # Added -Wno-missing-field-initializers to shut GCC up over {0} struct initialisers [ENV['CFLAGS']] -LIBCHECK = "/usr/lib/libcheck.a" + +LIBCHECK = File.exists?("/usr/lib/libcheck.a") ? + "/usr/lib/libcheck.a" : + "/usr/local/lib/libcheck.a" TEST_MODULES = Dir["tests/unit/check_*.c"].map { |n| File.basename( n )[%r{check_(.+)\.c},1] } if DEBUG - LDFLAGS << ["-g", "-lefence"] + LDFLAGS << ["-g"] CCFLAGS << ["-g -DDEBUG"] end @@ -96,10 +99,10 @@ def gcc_link(target, objects) FileUtils.mkdir_p File.dirname( target ) sh "#{CC} #{LDFLAGS.join(' ')} "+ - LIBS.map { |l| "-l#{l}" }.join(" ")+ " -Isrc " + " -o #{target} "+ - objects.join(" ") + objects.join(" ") + + " "+LIBS.map { |l| "-l#{l}" }.join(" ") end def headers(c)