Class: Mkduino::AutogenSh

Inherits:
GeneratedFile show all
Defined in:
lib/autogen_sh.rb

Instance Attribute Summary

Attributes inherited from GeneratedFile

#backup_directory, #output_directory, #output_filename, #user_updates_file

Instance Method Summary collapse

Methods inherited from GeneratedFile

#apply_user_updates, #save_file, #save_user_updates, #write_file

Constructor Details

#initialize(output_filename = 'autogen.sh', options = {}) ⇒ AutogenSh

Returns a new instance of AutogenSh.



24
25
26
# File 'lib/autogen_sh.rb', line 24

def initialize output_filename = 'autogen.sh', options = {}
  super output_filename, options
end

Instance Method Details

#write_autogen_shObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/autogen_sh.rb', line 27

def write_autogen_sh
  puts("Writing #{@output_filename}")
  write_file do |f|
    f.puts <<-AUTOGEN_SH
#!/bin/sh
if [ -e 'Makefile.am' ] ; then
echo "Makefile.am Exists - reconfiguring..."
autoreconf --force --install -I config -I m4
echo
echo
echo "************************************"
echo "** Now run mkdir build ; cd build ; ../configure --host=avr **"
echo "************************************"
exit
fi
echo "Lets get your project started!"

echo '## Process this file with automake to produce Makefile.in' >> Makefile.am
echo No Makefile.am
AUTOGEN_SH
  end
  `chmod +x #{@output_directory}#{@output_filename}`
end