src empty

main
sandyx 11 months ago
parent 4eea7771c6
commit ad86b408ea

@ -2,15 +2,9 @@
#I'll put this in here as an example #I'll put this in here as an example
# make a folder called src and a folder called build #
# then put some c source code in src
# then run rub and watch it build
# of course you could make your own build.rb to build any project #should maybe use environment variables for these
# ruby might not let you modify CONSTANTS
# so put a $ in front of the name which makes
# them global and not CONSTANT
$CC="gcc" $CC="gcc"
CFLAGS="-O1 -march=native -std=c11" CFLAGS="-O1 -march=native -std=c11"
$EFLAGS = "" #extra flags $EFLAGS = "" #extra flags
@ -51,7 +45,6 @@ def parse(arg)
else else
#error "unknown argument: #{arg}" #error "unknown argument: #{arg}"
print arg
end end
case arg.split("=")[0] case arg.split("=")[0]
@ -75,12 +68,9 @@ end
#main build function #main build function
def main def main
#if Dir.children(SRCDIR).count == 0 error("src directory empty") if Dir.children(SRCDIR).count == 0
#error("src directory empty")
#end
error("src directory empty") unless Dir.children(SRCDIR)
#create a thread for each compilation unit
threads = [] threads = []
Dir.each_child(SRCDIR) {|x| Dir.each_child(SRCDIR) {|x|
@ -96,6 +86,7 @@ def main
until threads.map { |t| t.alive? }.include?(false) until threads.map { |t| t.alive? }.include?(false)
end end
#link
build = Dir.each_child(BUILDDIR) build = Dir.each_child(BUILDDIR)
o_files = [] o_files = []
build.each { |s| build.each { |s|

Loading…
Cancel
Save