2008-12-06 06:20:26 +00:00
|
|
|
load "base.rake"
|
|
|
|
|
|
|
|
C_SRCS = FileList["c_src/bdberl_drv.c"]
|
|
|
|
C_OBJS = FileList["c_src/bdberl_drv.o"]
|
|
|
|
|
|
|
|
CLEAN.include %w( c_src/*.o priv/*.so )
|
|
|
|
CLOBBER.include %w( c_src/system )
|
|
|
|
|
|
|
|
directory 'c_src'
|
|
|
|
|
|
|
|
DB_LIB = "c_src/system/lib/libdb.a"
|
2008-12-06 06:52:51 +00:00
|
|
|
DRIVER = "priv/bdberl_drv.so"
|
2008-12-06 06:20:26 +00:00
|
|
|
|
|
|
|
file DB_LIB do
|
|
|
|
sh "cd c_src && ./buildlib.sh 2>&1"
|
|
|
|
end
|
|
|
|
|
2008-12-06 06:52:51 +00:00
|
|
|
file DRIVER do
|
|
|
|
puts "linking priv/#{DRIVER}..."
|
|
|
|
sh "gcc #{erts_link_cflags()} c_src/*.o c_src/system/lib/libdb-*.a -o #{DRIVER}", :verbose => false
|
|
|
|
end
|
|
|
|
|
2008-12-06 06:20:26 +00:00
|
|
|
rule ".o" => ["%X.c"] do |t|
|
|
|
|
puts "compiling #{t.source}..."
|
|
|
|
sh "gcc -c -Wall -Werror -Ic_src/system/include -I#{erts_dir()}/include #{t.source} -o #{t.name}", :verbose => false
|
|
|
|
end
|
|
|
|
|
2008-12-06 06:52:51 +00:00
|
|
|
task :compile_c => ['c_src'] + C_OBJS
|
2008-12-06 06:20:26 +00:00
|
|
|
|
2008-12-06 06:52:51 +00:00
|
|
|
task :compile => [DB_LIB, :compile_c, DRIVER]
|
2008-12-06 06:20:26 +00:00
|
|
|
|