rakelib/compile.rake
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 24 Aug 2017 17:04:58 +0100
branchstx-8.0.0
changeset 176 84363aa38ff4
parent 169 f9f519bb10b6
child 181 3aaf65a5541c
permissions -rw-r--r--
Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun ...sources from working copy (which is done as security precaution to avoid source leak in case of coding error elsewhere)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
     1
desc 'Compile project'
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
     2
task :compile => :'compile:all'
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
STX_TOP_DIR = BUILD_DIR / 'stx'
136
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
     6
STX_CONF_DIR = BUILD_DIR
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
     7
STX_RULES_DIR = BUILD_DIR / '..' / 'makelib'
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
if win32?
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
  STC = STX_TOP_DIR / 'stc' / 'stc.exe'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
  LIBRUN = STX_TOP_DIR / 'librun' / 'objmingw' / 'librun.dll'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
else
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
  STC = STX_TOP_DIR / 'stc' / 'stc'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
  LIBRUN = STX_TOP_DIR / 'librun' / 'librun.so'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
91
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
    16
# Return true if stx:stc and stx:librun sources should be removed as soon 
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
    17
# as STC or librun is built. False otherwise (sources are not removed by 
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
    18
# rakefiles)
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
    19
#
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
    20
# Indeed this is a feeble protection as it's easy to trick this method. But 
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
    21
# the goal is not to protect sources but rather have a secondaty measure to
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
    22
# avoid sources to leak (for exaple, due to a bug in packaging scripts).
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
    23
# Unathorized subjects should not be able to checkout sources in first instance.
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
def should_remove_librun_and_stc_sources
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
    25
  !(core_developer? or ENV['RETAIN_STX_AND_LIBRUN_SOURCE'] == 'yespleaseretain!')
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    28
STC_BINARY_FILES = [        
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    29
    'cpu_arm.h',        
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    30
    'cpu_i386.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    31
    'cpu_x86_64.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    32
    'cpu_ia64.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    33
    'stc.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    34
    'stcIntern.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    35
    'stcVMdata.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    36
    'stcVMoffsets.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    37
    'stxAsmMacros.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    38
    'stxNames.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    39
    'stxOSDefs.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    40
    'stxTypeMacros.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    41
    'symbols.stc.seed',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    42
    'version.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    43
    'sha1.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    44
    'sha1.c',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    45
    'README',
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    47
    # UNIX specific
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    48
    'stx-config.sh',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    49
    'linuxIntern.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    50
    'freeBSDIntern.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    51
    'macIntern.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    52
    'Make.proto',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    53
    'stc',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    54
    'stc.1',
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
    55
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    56
    # Windows specific
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    57
    'stx-config.bat',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    58
    'mingwmake.bat',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    59
    'ntIntern.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    60
    'nt.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    61
    'Make.proto',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    62
    'stc.exe',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    63
]
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    64
    
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    65
LIBRUN_BINARY_FILES = [
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    66
    'libffi-3.2.1',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    67
    'md5.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    68
    'mcompiler.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    69
    'main.c',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    70
    'hmm.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    71
    'hmm.c',
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    73
    # UNIX specific
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    74
    'librun.so',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    75
    'librun.a',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    76
    'symlist.c',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    77
    'Make.proto',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    78
    'makefile',
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    80
    # Windows specific
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    81
    'bc.mak',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    82
    'mingwmake.bat',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    83
    'buildDate.h',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    84
    'genDate.com',
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    85
    File.join('objmingw' , 'librun.dll'),
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    86
    File.join('objmingw' , 'librun.lib'),
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    87
]        
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
    89
def cleanup_stc
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
    90
  if should_remove_librun_and_stc_sources
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
    91
    puts 'Cleaning up stc...'
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    begin
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    93
      rm_rf_ex STX_TOP_DIR / 'stc', exceptions: STC_BINARY_FILES
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
    rescue
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    95
      # When something goes wrong, be safe and remove whole directory...
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
    96
      rm_rf    STX_TOP_DIR / 'stc'
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
    end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
  end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   101
def cleanup_librun
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   102
  if should_remove_librun_and_stc_sources
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   103
    puts 'Cleaning up librun...'
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
    begin
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
   105
      rm_rf_ex STX_TOP_DIR / 'stc', exceptions: LIBRUN_BINARY_FILES
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
    rescue
176
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
   107
      # When something goes wrong, be safe and remove whole directory...
84363aa38ff4 Rakefiles: use (new) `rm_rf_ex()` file utility to wipe-out stx:stc and stx:librun
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 169
diff changeset
   108
      rm_rf    STX_TOP_DIR / 'librun'
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   109
    end
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
  end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   113
namespace :compile do
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   115
  task :all => %i(prereq pre main post)
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   117
  task :pre
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   118
  task :post
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   120
  task :prereq => %i(setup)
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   122
  task :main => %i(
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   123
      config
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   124
      libraries
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   125
      stc
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   126
      librun
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   127
      application
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   128
  )
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   130
  task :config => [STX_TOP_DIR / 'include']
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
  directory STX_TOP_DIR / 'include'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   134
  task :application => :'setup:dependencies'
93
650412e81596 Automatically extract package dependencies from project definition file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
   135
650412e81596 Automatically extract package dependencies from project definition file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
   136
138
Patrik Svestka <patrik.svestka@gmail.com>
parents: 137 136
diff changeset
   137
  task :config => [ STX_CONF_DIR / 'stx-config.make' ]
122
6fcb351d23a7 Use our own make configuration files rather than eXept's
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 111
diff changeset
   138
136
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
   139
  directory STX_CONF_DIR do 
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
   140
    mkdir_p STX_CONF_DIR
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
   141
  end
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
   142
    
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
   143
  file STX_CONF_DIR / 'stx-config.make' => STX_CONF_DIR  do
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
   144
    makelib_dir = Pathname.new(File.expand_path('makelib')).relative_path_from(Pathname.new(BUILD_DIR / 'stx' ))
138
Patrik Svestka <patrik.svestka@gmail.com>
parents: 137 136
diff changeset
   145
    File.open(STX_CONF_DIR / 'stx-config.make', 'w') do | f |
169
f9f519bb10b6 Use GNU target triplets to specify build targets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 168
diff changeset
   146
      f.puts "BUILD_TARGET ?= #{BUILD_TARGET}"
136
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
   147
    end
29bd0a3c4a31 Makefiles: configure Smalltalk/X by defining TARGET rather then symlinking a file
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 135
diff changeset
   148
  end 
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   150
  rule 'makefile' do |t|
169
f9f519bb10b6 Use GNU target triplets to specify build targets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 168
diff changeset
   151
    chdir File.dirname(t.name) do
f9f519bb10b6 Use GNU target triplets to specify build targets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 168
diff changeset
   152
      sh "'#{STX_TOP_DIR / 'rules' / 'stmkmf'}'"
f9f519bb10b6 Use GNU target triplets to specify build targets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 168
diff changeset
   153
    end
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   154
  end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   156
  task :stc do
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   157
    chdir STX_TOP_DIR / 'stc' do
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   158
      begin
169
f9f519bb10b6 Use GNU target triplets to specify build targets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 168
diff changeset
   159
        make
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   160
        cleanup_stc
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
      rescue Exception => e
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   162
        cleanup_stc
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   163
        cleanup_librun
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   164
        error "Cannot compile stx:stc: #{e.message}"
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   165
      end
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   166
    end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   167
138
Patrik Svestka <patrik.svestka@gmail.com>
parents: 137 136
diff changeset
   168
    (cp STX_TOP_DIR / 'stc' / 'stx-config.h', STX_TOP_DIR / 'include' / 'stx-config.h') unless File.exist?(STX_TOP_DIR / 'include' / 'stx-config.h')
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   169
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   170
    unless File.exist? STC
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   171
      cleanup_stc
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   172
      cleanup_librun
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   173
      error 'Cannot compile stx:stc'
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
    end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
  end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   177
  task :librun do
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
    chdir STX_TOP_DIR / 'librun' do
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
      begin
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
        begin
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   181
          if win32_wine?
138
Patrik Svestka <patrik.svestka@gmail.com>
parents: 137 136
diff changeset
   182
            (mkdir 'libffi' / 'build_win32' / 'objbc') unless File.exist?('libffi' / 'build_win32' / 'objbc')
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   183
          end
111
767f2ace9b82 Win32: A nasty workaround to avoid Borland make to crash under Windows 10
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   184
          # A workaround for Windows 10 & ancient Borland make which 
767f2ace9b82 Win32: A nasty workaround to avoid Borland make to crash under Windows 10
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   185
          # tend to crash there when trying to recompile already compiled
767f2ace9b82 Win32: A nasty workaround to avoid Borland make to crash under Windows 10
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   186
          # librun. Sigh, we have to move away from it as soon as possible!
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   187
          (touch 'stxmain.c') if (win32? and File.exist? 'stxmain.c')
91
76f23122e86a Added option (env var) to tell rakefiles to retain stc and librun sources.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 87
diff changeset
   188
          make
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   189
          cleanup_librun
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   190
        rescue Exception => e
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   191
          cleanup_stc
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   192
          cleanup_librun
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   193
          error "Cannot compile stx:librun: #{e.message}"
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
        end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
      end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
    end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
  end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
  if unix?
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
    task :stc => STX_TOP_DIR / 'stc' / 'makefile'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
    task :librun => STX_TOP_DIR / 'librun' / 'makefile'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
  end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   204
  if win32? and TOOLCHAIN == 'bcc'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
    directory STX_TOP_DIR / 'lib' / 'bc'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   206
    task :librun => STX_TOP_DIR / 'lib' / 'bc'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   207
  end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   208
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   209
  task :'libraries'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   210
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   211
  if unix?
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   212
    vogl_dir = STX_TOP_DIR / 'support' / 'VGL' / 'vogl'
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   213
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   214
    task 'libraries' => [vogl_dir / 'src' / 'libvogl.a']
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
137
e665031cade7 Cleaning up code and having it more rubyish
Patrik Svestka <patrik.svestka@gmail.com>
parents: 122
diff changeset
   216
    file vogl_dir / 'src' / 'libvogl.a' => [vogl_dir / 'makefile'] do
138
Patrik Svestka <patrik.svestka@gmail.com>
parents: 137 136
diff changeset
   217
      chdir STX_TOP_DIR / 'support' / 'VGL' / 'vogl' do; make; end
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   218
    end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
  end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   220
end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
133
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   223
task "stx:librun:symbols"
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   224
97
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   225
#
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   226
# Various compilation hacks here and there (sigh)
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   227
# 
133
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   228
desc "Update the VM symbol database"
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   229
task 'stx:librun:symbols' do | task |    
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   230
  symbols_stc = BUILD_DIR / 'stx' / 'include' / 'symbols.stc'
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   231
  if unix?
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   232
    # UNIX VMs have the symbol database built into the binary as
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   233
    # static data so we need to recompile the VM
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   234
    stx_librun = project.package('stx:librun')
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   235
    stx_librun_dll = BUILD_DIR / stx_librun.directory() / OBJ_DIR / stx_librun.dll_name()
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   236
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   237
    if not uptodate?(stx_librun_dll, [ symbols_stc ]) then
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   238
      Rake::Task["stx:librun"].reenable()
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   239
      Rake::Task["stx:librun"].invoke()
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   240
    end
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   241
  elsif win32? 
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   242
    # Windows VM reads the symbol database from a file `symbols.stc` located
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   243
    # alongside the program executable so we need to copy that file
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   244
    app = project.application
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   245
    symbols_stc_in_app_directory = BUILD_DIR / app.directory() / 'symbols.stc'
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   246
    if not uptodate?(symbols_stc_in_app_directory, [ symbols_stc ]) then
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   247
      cp symbols_stc, symbols_stc_in_app_directory
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   248
    end
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   249
  end
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   250
  task.reenable()
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   251
end
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   252
97
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   253
if unix?
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   254
  # A hack for Debian (and possibly other Linux distros) that does not ship
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   255
  # 32bit libodbc.a / libodbcinst.a. Link directly against .so
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   256
  task :'stx:libdb/libodbc:pre' do     
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   257
	  sed('-lodbc -lodbcinst' , '-l:libodbc.so.2 -l:libodbcinst.so.2', BUILD_DIR / 'stx' / 'libdb' / 'libodbc' / 'Make.proto', true)
33cf3197acb5 Added hack for compiling 32bit stx:libdb/libodbc on 64bit Linux
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 94
diff changeset
   258
  end  
0
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   259
end
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   260
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   261
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   262
f46260ba26b1 Initial shot of "new" rake-based builder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   263
133
8229af6e81df Rakefiles: update VM's symbol database after a package compiled
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 122
diff changeset
   264