class RBT::GenerateMakefile
Constants
- NAME_OF_MAKEFILE
#¶ ↑
NAME_OF_MAKEFILE
¶ ↑#¶ ↑
- NAME_OF_THE_FILE_HERE
#¶ ↑
NAME_OF_THE_FILE_HERE
¶ ↑#¶ ↑
- WHICH_SHELL_TO_USE
#¶ ↑
WHICH_SHELL_TO_USE
¶ ↑#¶ ↑
Attributes
base_dir[W]
Public Class Methods
Public Instance Methods
add_comment()
click to toggle source
add_header()
click to toggle source
add_newline()
click to toggle source
add_tabs()
click to toggle source
create_makefile_variable(this_variable)
click to toggle source
create_rule( name_of_rule, action, extended_instruction_set = '' )
click to toggle source
#¶ ↑
create_rule
¶ ↑
Use this to create a specific rule.
#¶ ↑
# File lib/rbt/utility_scripts/generate_makefile.rb, line 127 def create_rule( name_of_rule, action, extended_instruction_set = '' ) extended_instruction_set = ' '+extended_instruction_set unless extended_instruction_set.empty? @_ << N # right now, we always add a newline @_ << name_of_rule+':'+extended_instruction_set+N @_ << TABULATOR+action+N # rm *.o temp end
data?()
click to toggle source
fill_up_string()
click to toggle source
#¶ ↑
fill_up_string
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/generate_makefile.rb, line 165 def fill_up_string @_ << '# =========================================================================== # # MACRO LISTING # =========================================================================== # SHELL='+WHICH_SHELL_TO_USE+' # =========================================================================== # # CFLAGS TO USE # =========================================================================== # CFLAGS = -O -systype bsd43 # =========================================================================== # # COMPILE TO USE # =========================================================================== # CC=gcc CCOPTS=-Wall # =========================================================================== # # TARGET # =========================================================================== # foobar.dvi: $(SRCS) $(DITROFF) $(MACROS) $(SRCS) >paper.dvi id3: id3.c $(CC) $(CCOPTS) -o id3 id3.c prefix = '+prefix?+' exec_prefix = ${prefix} ' end
input(i)
click to toggle source
prefix?()
click to toggle source
report_what_we_will_do()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
Bundle together the various actions.
#¶ ↑
# File lib/rbt/utility_scripts/generate_makefile.rb, line 263 def run check_against_input report_what_we_will_do add_header fill_up_string create_rule 'joe_goes_crazy', 'echo "ok joe is crazy..."' create_rule 'all','g++ main.cpp hello.cpp factorial.cpp -o hello' create_rule 'hello','g++ main.o factorial.o hello.o -o hello','main.o factorial.o hello.o' sanitize add_tabs # should be called right before save_to is invoked save_to('Makefile') end
sanitize()
click to toggle source
save_to( where_to = 'Makefile', mode_to_use = 'w+' )
click to toggle source
#¶ ↑
save_to
¶ ↑
Where to save the Makefile.
#¶ ↑
# File lib/rbt/utility_scripts/generate_makefile.rb, line 210 def save_to( where_to = 'Makefile', mode_to_use = 'w+' ) if File.exist? where_to name = 'old_Makefile' e 'A Makefile already exists. We will rename this Makefile' e 'to '+sfile(name)+' before generating a new Makefile.' mv('Makefile', name) end save_what_into(data?, where_to) end