ProjectBuilder.st
author Claus Gittinger <cg@exept.de>
Tue, 28 Jan 2014 21:59:08 +0100
changeset 3075 ae4ba1019eb5
parent 3072 117522ff72bc
child 3127 f28722d20fbb
permissions -rw-r--r--
class: MenuEditor changed: #doSave oops - package was not always preserved when compiling (generated methods where reassigned)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2741
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     1
"
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     2
 COPYRIGHT (c) 2009 by eXept Software AG
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     3
              All Rights Reserved
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     4
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     5
 This software is furnished under a license and may be used
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     6
 only in accordance with the terms of that license and with the
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     8
 be provided or otherwise made available to, or used by, any
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
     9
 other person.  No title to or ownership of the software is
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    10
 hereby transferred.
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    11
"
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libtool2' }"
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
2635
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
    14
"{ NameSpace: Tools }"
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
    15
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
Object subclass:#ProjectBuilder
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:'package projectDefinitionClass sourceCodeManager buildDirectory
2673
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
    18
		myWorkingDirectory mySTXTopDirectory myTopDirectory outputStream
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
    19
		makeExeOnly makeQuick usedCompiler stdOut stdErr isQuickBuild
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
    20
		isLocalBuild'
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	classVariableNames:'PreviousBuildDirectory'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	poolDictionaries:''
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
	category:'System-Support-Projects'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
2741
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    26
!ProjectBuilder class methodsFor:'documentation'!
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    27
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    28
copyright
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    29
"
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    30
 COPYRIGHT (c) 2009 by eXept Software AG
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    31
              All Rights Reserved
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    32
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    33
 This software is furnished under a license and may be used
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    34
 only in accordance with the terms of that license and with the
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    35
 inclusion of the above copyright notice.   This software may not
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    36
 be provided or otherwise made available to, or used by, any
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    37
 other person.  No title to or ownership of the software is
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    38
 hereby transferred.
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    39
"
783dda495655 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2723
diff changeset
    40
! !
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
2633
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    42
!ProjectBuilder class methodsFor:'accessing'!
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    43
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    44
previousBuildDirectory
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    45
    ^ PreviousBuildDirectory
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    46
!
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    47
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    48
previousBuildDirectory:something
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    49
    PreviousBuildDirectory := something.
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    50
! !
Claus Gittinger <cg@exept.de>
parents: 2628
diff changeset
    51
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
!ProjectBuilder class methodsFor:'examples'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    54
example1
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    55
    Smalltalk loadPackage:'stx:projects/helloWorldApp' asAutoloaded:true.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    56
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    57
    self new
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    58
        package:'stx:projects/helloWorldApp';
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    59
        build
2622
e55f43981463 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
    60
!
e55f43981463 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
    61
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    62
example2
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    63
    |builder|
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    64
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    65
    Smalltalk loadPackage:'stx:clients/Demos/foxCalcApplication' asAutoloaded:true.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    66
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    67
    builder := self new.
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
    68
    builder 
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
    69
        package:'stx:clients/Demos/foxCalcApplication';
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
    70
        build.
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    71
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
    72
    UserPreferences fileBrowserClass openOnDirectory:builder packageBuildDirectory.
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
    73
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
    74
    "Modified: / 03-09-2012 / 19:23:53 / cg"
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
! !
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    77
!ProjectBuilder class methodsFor:'queries'!
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    78
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    79
defaultUsedCompiler
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    80
    |compiler|
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    81
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    82
    (compiler := UserPreferences current usedCompilerForBuild) notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    83
        ^ compiler
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    84
    ].
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    85
3006
741e3e2f0270 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3001
diff changeset
    86
    ^ ParserFlags usedCompiler
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    87
!
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    88
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    89
listOfPossibleCompilers
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
    90
    OperatingSystem isMSWINDOWSlike ifTrue:[
2918
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
    91
        OperatingSystem getLoginName = 'cg' ifTrue:[
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
    92
            ^ #(
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
    93
                'bcc'   "/ OK
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
    94
                'vc'    "/ almost OK
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
    95
                'lcc'   "/ experimental, but only free for non-commercial work
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
    96
                'tcc'   "/ experimental; limited but free
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
    97
                'mingw' "/ experimental; free
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
    98
             )
2918
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
    99
        ].
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   100
        ^ #('bcc' 'vc' 'mingw' )
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   101
    ].
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   102
    ^ #('gcc')
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   103
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   104
    "Created: / 21-01-2012 / 14:04:15 / cg"
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   105
!
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   106
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   107
suiteNameOfCompiler:usedCompiler
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   108
    usedCompiler = 'bcc' ifTrue:[
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   109
        ^ 'Borland C-Compiler'.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   110
    ].
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   111
    usedCompiler = 'vc' ifTrue:[
2974
8cf2b51872fd class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2972
diff changeset
   112
        ^ 'Microsoft Visual C Compiler'.
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   113
    ].
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   114
    usedCompiler = 'lcc' ifTrue:[
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   115
        ^ 'LCC C-Compiler'.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   116
    ].
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   117
    usedCompiler = 'tcc' ifTrue:[
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   118
        ^ 'Tiny C-Compiler'.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   119
    ].
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   120
    usedCompiler = 'gcc' ifTrue:[
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   121
        ^ 'GNU C-Compiler'.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   122
    ].
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   123
    usedCompiler = 'mingw' ifTrue:[
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   124
        ^ 'MINGW GNU C-Compiler'.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   125
    ].
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   126
    self halt:'unknown compiler'.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   127
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   128
    ^ 'C-Compiler'.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   129
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   130
    "Created: / 06-09-2012 / 15:58:33 / cg"
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   131
! !
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   132
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
!ProjectBuilder methodsFor:'accessing'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   135
buildDirectory
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   136
    ^ buildDirectory
2622
e55f43981463 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   137
!
e55f43981463 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   138
2634
3f14301cec84 added: #buildDirectory:
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   139
buildDirectory:something
3f14301cec84 added: #buildDirectory:
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   140
    buildDirectory := something.
3f14301cec84 added: #buildDirectory:
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   141
!
3f14301cec84 added: #buildDirectory:
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   142
2964
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   143
isLocalBuild
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   144
    ^ isLocalBuild ? false
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   145
!
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   146
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   147
isLocalBuild:aBoolean
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   148
    "create a files without going through the source code manager"
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   149
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   150
    isLocalBuild := aBoolean.
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   151
!
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   152
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   153
isQuickBuild
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   154
    ^ isQuickBuild ? false
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   155
!
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   156
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   157
isQuickBuild:aBoolean
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   158
    "skips creation of header files, and copying of support files, if possible
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   159
     to speedup a build. Use with care."
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   160
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   161
    isQuickBuild := aBoolean.
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   162
!
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   163
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   164
makeExeOnly
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   165
    ^ (makeExeOnly ? false)
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   166
!
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   167
2673
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   168
makeExeOnly:aBoolean
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   169
    makeExeOnly := aBoolean.
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   170
!
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   171
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   172
makeQuick
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   173
    ^ (makeQuick ? false)
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   174
!
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   175
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   176
makeQuick:aBoolean
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   177
    makeQuick := aBoolean.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   178
!
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   179
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   180
package:aPackageIDOrSymbol
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   181
    package := aPackageIDOrSymbol asPackageId.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   184
packageBuildDirectory
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   185
    "the directoray, where the deployable binary is created (xxxSetup.exe)"
2622
e55f43981463 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   186
e55f43981463 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   187
    ^ buildDirectory / (package asPackageId module) / (package asPackageId directory)
2635
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
   188
!
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
   189
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   190
projectDefinitionClass:something
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   191
    projectDefinitionClass := something.
2680
3f2dbbd7743f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2678
diff changeset
   192
!
3f2dbbd7743f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2678
diff changeset
   193
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   194
suffixForHeaderFiles
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   195
    ^ OperatingSystem isUNIXlike ifTrue:['.H'] ifFalse:['.STH']
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   196
!
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   197
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   198
usedCompilerForBuild:something
2680
3f2dbbd7743f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2678
diff changeset
   199
    usedCompiler := something.
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   200
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   201
    "Created: / 22-01-2012 / 10:50:48 / cg"
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
! !
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
!ProjectBuilder methodsFor:'building'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   206
build
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   207
    "/ intermediate - this will move into a commonly used utility class
2635
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
   208
    "/ (where all the project code support will be collected).
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
   209
2647
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   210
    |makeOutput|
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   211
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   212
    makeOutput := TextStream on:(Text new:10000).
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   213
    self buildWithColorizedOutputTo:makeOutput.
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   214
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   215
    TextView openWith:makeOutput contents.
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   216
!
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   217
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   218
buildWithColorizedOutputTo:makeOutput
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   219
    "/ intermediate - this will move into a commonly used utility class
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   220
    "/ (where all the project code support will be collected).
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   221
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   222
    |lock|
2635
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
   223
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   224
    lock := Semaphore forMutualExclusion.
2647
aedc794b630a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   225
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   226
    stdErr := ActorStream new
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   227
                    nextPutBlock:[:char |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   228
                        lock critical:[
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   229
                            makeOutput 
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   230
                                withEmphasis:{#backgroundColor->Color red. #color->Color white.}
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   231
                                do:[makeOutput nextPut:char].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   232
                        ]
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   233
                    ];
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   234
                    nextPutAllBlock:[:string |
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   235
                        lock critical:[          
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   236
                            makeOutput
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   237
                                withEmphasis:{#backgroundColor->Color red. #color->Color white.}
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   238
                                do:[makeOutput nextPutAll:string].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   239
                        ]
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   240
                    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   241
    stdOut := ActorStream new
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   242
                    nextPutBlock:[:char |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   243
                        lock critical:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   244
                            makeOutput nextPut:char.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   245
                        ]
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   246
                    ];
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   247
                    nextPutAllBlock:[:string |
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   248
                        lock critical:[         
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   249
                            makeOutput nextPutAll:string.
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   250
                        ]
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   251
                    ].
2635
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
   252
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   253
    self buildWithOutputTo:stdOut errorTo:stdErr.
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   254
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   255
    "Modified: / 06-09-2012 / 16:15:50 / cg"
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   256
!
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   257
2969
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   258
buildWithOutputTo:stdOutArg errorTo:stdErrArg
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   259
    "/ intermediate - this will move into a commonly used utility class
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   260
    "/ (where all the project code support will be collected).
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   261
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
    |module directory|
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
    projectDefinitionClass := ProjectDefinition definitionClassForPackage:package.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
    projectDefinitionClass isNil ifTrue:[
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
        self error:('Missing ProjectDefinition class for "',package asString,'"')
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
    "/ ensure that everything is loaded...
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
    projectDefinitionClass loadAsAutoloaded:false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
    projectDefinitionClass loadExtensions.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
    projectDefinitionClass loadAllClassesAsAutoloaded:false.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
    module := package module.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
    directory := package directory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
    buildDirectory isNil ifTrue:[
2634
3f14301cec84 added: #buildDirectory:
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   278
        buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ].
3f14301cec84 added: #buildDirectory:
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   279
        buildDirectory isNil ifTrue:[
3f14301cec84 added: #buildDirectory:
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   280
            buildDirectory := Filename tempDirectory construct:'stx_build'.
3f14301cec84 added: #buildDirectory:
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
   281
        ].
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
    buildDirectory := buildDirectory asFilename.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
    "/ self validateBuildDirectoryIsPresent.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
    PreviousBuildDirectory := buildDirectory.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
    "/ UserPreferences current localBuild:true
2964
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   290
    (self isLocalBuild or:[UserPreferences current localBuild]) ifFalse:[
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
        SourceCodeManager notNil ifTrue:[
3043
457d1202c86b class: Tools::ProjectBuilder
Stefan Vogel <sv@exept.de>
parents: 3042
diff changeset
   292
            sourceCodeManager := SourceCodeManagerUtilities sourceCodeManagerFor:projectDefinitionClass.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
        ]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
    ].
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
    sourceCodeManager := nil.
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   297
    myTopDirectory := 
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
        Smalltalk packagePath 
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
            detect:[:aPath |
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
                (aPath asFilename / 'stx' / 'include') exists
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
                and: [ (aPath asFilename / 'stx' / 'rules') exists ]]
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
            ifNone:nil.       
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   303
    myTopDirectory isNil ifTrue:[
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   304
        self error:('Cannot figure out my top directory (where stx/include and stx/rules are)')
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    ].
2598
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   306
    myTopDirectory := myTopDirectory asFilename.
2bb47a698d59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2596
diff changeset
   307
    mySTXTopDirectory := myTopDirectory / 'stx'.
2613
b8d38caaa884 changed: #buildWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents: 2612
diff changeset
   308
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   309
    self makeQuick ifFalse:[
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   310
        self setupBuildDirectory.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   311
        self activityNotification:'Generating stc directory...'.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   312
        self copySTCDirectoryForBuild.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   313
    ].
2628
57b363325368 changed:
Claus Gittinger <cg@exept.de>
parents: 2622
diff changeset
   314
    self activityNotification:'Generating source files...'.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
    self generateSourceFiles.
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   316
    self makeQuick ifFalse:[
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   317
        self activityNotification:'Copying dlls for linkage...'.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   318
        self copyDLLsForLinkage.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   319
        self activityNotification:'Copying support files for compilation and linkage...'.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   320
        self copySupportFilesForCompilation.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   321
        self copySupportFilesForLinkage.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   322
        self copyStartupFilesFromSmalltalk.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   323
    ].
2628
57b363325368 changed:
Claus Gittinger <cg@exept.de>
parents: 2622
diff changeset
   324
    self activityNotification:'Executing make...'.
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
   325
    self makeWithOutputTo:stdOut errorTo:stdErr.
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   326
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   327
    "Modified: / 04-09-2012 / 00:49:52 / cg"
2898
c7f6c498df6a category of:15 methods
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
   328
! !
c7f6c498df6a category of:15 methods
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
   329
c7f6c498df6a category of:15 methods
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
   330
!ProjectBuilder methodsFor:'building/private'!
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   332
copyDLLsForLinkage
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   333
    |targetBuildDir preRequisites dllRelativeSourcePathes dllRelativeDestPathes|
2723
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   334
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   335
    targetBuildDir := buildDirectory / package module / package directory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   336
2723
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   337
    preRequisites := projectDefinitionClass allPreRequisites.
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   338
    OperatingSystem isUNIXlike ifTrue:[
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   339
        "For now: unix Makefiles require some libs implicitely..."
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   340
        preRequisites := preRequisites union:#(
2979
06dcbe5668a4 class: Tools::ProjectBuilder
Stefan Vogel <sv@exept.de>
parents: 2974
diff changeset
   341
                               #'stx:goodies/refactoryBrowser/parser'
06dcbe5668a4 class: Tools::ProjectBuilder
Stefan Vogel <sv@exept.de>
parents: 2974
diff changeset
   342
                               #'stx:libtool'
2723
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   343
                            ).
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   344
    ].
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   345
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   346
    preRequisites do:[:eachPackageToFileout |
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   347
        |packageId packageDef packageModule packageDirectory packageTargetDir
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   348
         dllSource dllSourceDir libraryName dllRelativePathSource 
2916
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   349
         dllRelativePathDest objDirSource objDirDest alternativeObjDirSource|
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   350
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   351
        packageId := eachPackageToFileout asPackageId.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   352
        packageModule := packageId module.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   353
        packageDirectory := packageId directory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   354
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   355
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   356
        packageDef := packageId projectDefinitionClass.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   357
        libraryName := packageDef libraryName.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   358
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   359
        "/ mhmh - take them from my tree or from the projects/smalltalk execution directory ??
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   360
        dllSourceDir := myTopDirectory / packageModule / packageDirectory.
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   361
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   362
        OperatingSystem isMSWINDOWSlike ifTrue:[
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   363
            objDirDest := self objDirForUsedCompiler:usedCompiler.
2916
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   364
            objDirSource := objDirDest.
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   365
"/            "/ use visual-c files for tcc linkage
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   366
"/            usedCompiler = 'tcc' ifTrue:[
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   367
"/                objDirSource := self objDirForUsedCompiler:'vc'.
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   368
"/            ] ifFalse:[
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   369
"/                objDirSource := objDirDest
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   370
"/            ].
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   371
            (dllSourceDir / objDirSource / (libraryName, '.dll')) exists ifFalse:[
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   372
                alternativeObjDirSource := self objDirForUsedCompiler:'vc'.
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   373
                (dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   374
                    objDirSource := alternativeObjDirSource.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   375
                    stdErr nextPutLine:(('Warning: using alternative %1 from %2 (%3 version)...' 
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   376
                                                bindWith:libraryName 
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   377
                                                with:alternativeObjDirSource 
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   378
                                                with:(self class suiteNameOfCompiler:'vc'))
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   379
                                            emphasizeAllWith:(#color -> Color red darkened)).
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   380
                ] ifFalse:[
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   381
                    alternativeObjDirSource := self objDirForUsedCompiler:'bcc'.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   382
                    (dllSourceDir / alternativeObjDirSource / (libraryName, '.dll')) exists ifTrue:[
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   383
                        objDirSource := alternativeObjDirSource.
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   384
                        stdErr nextPutLine:('Warning: using alternative %1 from %2 (%3 version)...' 
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   385
                                    bindWith:libraryName 
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   386
                                    with:alternativeObjDirSource 
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   387
                                    with:(self class suiteNameOfCompiler:'bcc')).
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   388
                    ]
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   389
                ].
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   390
            ].
2916
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   391
2905
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   392
"/            dllRelativePath := objDir,'/',(libraryName,'.dll').
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   393
"/            (dllSourceDir / dllRelativePath) exists 
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   394
            dllRelativeSourcePathes := Array with:(objDirSource,'\', libraryName, '.dll').
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   395
            dllRelativeDestPathes := Array with:(objDirDest,'\', libraryName, '.dll').
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   396
        ] ifFalse:[
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   397
            dllRelativeSourcePathes := Array with:(libraryName,'.so').
2958
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   398
            dllRelativeDestPathes := Array with:(libraryName, '.so').
2723
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   399
            (packageModule = 'stx' and:[packageDirectory = 'libview']) ifTrue:[
2958
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   400
                dllRelativeSourcePathes := dllRelativeSourcePathes copyWith:('XWorkstation.so').
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   401
                dllRelativeDestPathes := dllRelativeDestPathes copyWith:'XWorkstation.so'.
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   402
                dllRelativeSourcePathes := dllRelativeSourcePathes copyWith:('GLXWorkstation.so').
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   403
                dllRelativeDestPathes := dllRelativeDestPathes copyWith:'GLXWorkstation.so'.
2723
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   404
            ].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   405
        ].
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   406
        dllRelativeSourcePathes with:dllRelativeDestPathes do:[:dllRelativeSourcePath :dllRelativeDestPath|
2896
6ed90332dbda changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
   407
            |source dest|
6ed90332dbda changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
   408
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   409
            source := dllSourceDir / dllRelativeSourcePath.
2958
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   410
            source exists ifFalse:[
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   411
                self activityNotification:'   skip missing file: ',source pathName.
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   412
            ] ifTrue:[
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   413
                dest := packageTargetDir / dllRelativeDestPath.
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   414
                (dest exists not
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   415
                 or:[source fileSize ~= dest fileSize
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   416
                 or:[source modificationTime >= dest modificationTime
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   417
                 "/ or:[ ((dllSourceDir / dllRelativePath) sameContentsAs:(packageTargetDir / dllRelativePath)) not ]
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   418
                ]]) ifTrue:[
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   419
                    Transcript showCR:'updating ',dllRelativeDestPath.
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   420
                    dest directory recursiveMakeDirectory.
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   421
                    source copyTo:dest.    
2986
1175ca171983 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2985
diff changeset
   422
                    self activityNotification:'    ',dest pathName
3041
380d18b00312 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
   423
                ] ifFalse:[
380d18b00312 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
   424
                    Transcript showCR:'already up-to-date: ',dllRelativeDestPath.
380d18b00312 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3006
diff changeset
   425
                ]
2958
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   426
            ]
2723
d03a850ebc29 changed: #copyDLLsForLinkage
Stefan Vogel <sv@exept.de>
parents: 2684
diff changeset
   427
        ].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   428
    ].
2896
6ed90332dbda changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
   429
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   430
    "Modified: / 06-09-2012 / 16:19:29 / cg"
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   431
!
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   432
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   433
copyDirectory:relativepath
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   434
    "/ need rules in stx
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   435
    ((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:relativepath)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   436
        recursiveCopyTo:(buildDirectory construct:'stx').
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   437
!
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   438
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   439
copyDirectoryForBuild:subdir
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   440
    |targetDir targetFile|
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   441
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   442
    targetDir := buildDirectory / 'stx' / subdir.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   443
    targetDir exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   444
        targetDir makeDirectory.
2964
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   445
    ] ifTrue:[
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   446
        self isQuickBuild ifTrue:[^ self]
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   447
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   448
    (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   449
        eachFile isDirectory ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   450
            targetFile := targetDir / eachFile baseName.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   451
            (targetFile exists not
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   452
            or:[ targetFile modificationTime < eachFile modificationTime ]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   453
                self activityNotification:'copying ',eachFile pathName,'...'.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   454
                eachFile copyTo:(targetDir construct:eachFile baseName)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   455
            ]
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   456
        ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   457
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   458
    self activityNotification:nil
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   459
!
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   460
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   461
copyResourcesForPackage:aPackage
2981
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   462
    |module directory myPackageDirectory rsrcDir stylesDir|
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   463
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   464
    module := aPackage asPackageId module.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   465
    directory := aPackage asPackageId directory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   466
2981
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   467
    myPackageDirectory := myTopDirectory / module / directory.
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   468
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   469
    (rsrcDir := myPackageDirectory / 'resources' ) exists ifTrue:[
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   470
        rsrcDir recursiveCopyTo:(buildDirectory / module / directory)
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   471
    ].
2981
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   472
    (stylesDir := myPackageDirectory / 'styles' ) exists ifTrue:[
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   473
        stylesDir recursiveCopyTo:(buildDirectory / module / directory)
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   474
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   475
!
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   476
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   477
copySTCDirectoryForBuild
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   478
    "copy stc files to the build directory"
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   479
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   480
    |targetDir stc files|
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   481
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   482
    targetDir := buildDirectory / 'stx' / 'stc'.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   483
    targetDir exists ifFalse:[ targetDir makeDirectory ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   484
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   485
    stc := OperatingSystem isMSWINDOWSlike 
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   486
                ifTrue:[ 'stc.exe' ]
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   487
                ifFalse:[ 'stc' ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   488
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   489
    files := #( ) copyWith:stc.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   490
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   491
    files do:[:eachFile |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   492
        |sourceFile targetFile|
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   493
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   494
        sourceFile := mySTXTopDirectory / 'stc' / eachFile.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   495
        targetFile := targetDir / eachFile.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   496
        (targetFile exists not
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   497
        or:[ targetFile modificationTime < sourceFile modificationTime ]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   498
            self activityNotification:'copying ',sourceFile pathName,'...'.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   499
            sourceFile copyTo:targetFile
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   500
        ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   501
    ].
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   502
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   503
    OperatingSystem isUNIXlike ifTrue:[
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   504
        (targetDir / 'stc') makeExecutableForAll    
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   505
    ].
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   506
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   507
    self activityNotification:nil
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   508
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   509
    "Modified (comment): / 04-09-2012 / 00:49:19 / cg"
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   510
!
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   511
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   512
copyStartupFilesFromSmalltalk
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   513
    "copy additional smalltalk startup files to the build directory"
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   514
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   515
    (buildDirectory / 'stx' / 'projects/smalltalk' ) exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   516
        (buildDirectory / 'stx' / 'projects/smalltalk' ) recursiveMakeDirectory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   517
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   518
2678
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   519
    #( 
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   520
        'keyboard.rc' 
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   521
        'keyboardMacros.rc' 
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   522
        'display.rc' 
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   523
        'd_win32.rc'
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   524
        'host.rc' 
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   525
        'h_win32.rc'  
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   526
        'smalltalk.rc'  
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   527
        'private.rc'  
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   528
    ) do:[:fn |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   529
        (myTopDirectory / 'stx' / 'projects/smalltalk' / fn)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   530
            copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / fn)
2678
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   531
    ].
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   532
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   533
    (myTopDirectory / 'stx' / 'doc/online/english/LICENCE_STX.html')
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   534
            copyTo: (buildDirectory / 'stx' / 'projects/smalltalk' / 'LICENCE_STX.html').
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   535
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   536
    "Modified (comment): / 04-09-2012 / 00:48:47 / cg"
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   537
!
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   538
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   539
copySupportFilesForCompilation
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   540
    "copy the tcc compiler to the build directory"
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   541
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   542
    |files|
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   543
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   544
    files := #().
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   545
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   546
    OperatingSystem isMSWINDOWSlike ifTrue:[
2984
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   547
        files := files , #( 
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   548
                        'librun/genDate.com' 
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   549
                    ).
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   550
        usedCompiler = 'tcc' ifTrue:[
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   551
            files := files , #( 
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   552
                        'support/tcc'
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   553
                    ).
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   554
        ].
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   555
    ] ifFalse:[
2984
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   556
        files := files , #( 
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   557
                        "/ 'librun/genDate'   -- not needed on unix (done via script)
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   558
                        'configurations/myConf' 
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   559
                        'configurations/vendorConf' 
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   560
                        'configurations/conf.inc' 
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   561
                        'configurations/COMMON' 
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   562
                    ).
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   563
    ].
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   564
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   565
    files do:[:relativePath |
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   566
        (mySTXTopDirectory / relativePath) exists ifTrue:[
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   567
            ((buildDirectory / 'stx' / relativePath) exists
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   568
            and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   569
            and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   570
            "/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ]
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   571
            ]]) ifFalse:[
2984
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   572
                (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory.    
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   573
                (mySTXTopDirectory / relativePath) isDirectory ifTrue:[
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   574
                    (mySTXTopDirectory / relativePath) recursiveCopyTo:(buildDirectory / 'stx' / relativePath) directory.    
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   575
                ] ifFalse:[
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   576
                    (mySTXTopDirectory / relativePath) copyTo:(buildDirectory / 'stx' / relativePath) directory.    
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   577
                ]
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   578
            ]
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   579
        ] ifFalse:[
2984
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   580
            self error:'Missing file or directory: ',relativePath printString mayProceed:true.
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   581
        ].
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   582
    ].
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   583
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   584
    "Created: / 04-09-2012 / 00:47:49 / cg"
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   585
!
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   586
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   587
copySupportFilesForLinkage
2912
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   588
    "copy additional files which are req'd for linkage to the build directory"
6e62954c5f35 added: #copySupportFilesForCompilation
Claus Gittinger <cg@exept.de>
parents: 2911
diff changeset
   589
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   590
    |files|
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   591
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   592
    OperatingSystem isMSWINDOWSlike ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   593
        files := #( 
2969
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   594
                    'librun/genDate.com'
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   595
                    'librun/main.c'
2673
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   596
                    'projects/smalltalk/stx_16x16.ico'
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   597
                    'projects/smalltalk/stx_32x32.ico'
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   598
                    'projects/smalltalk/stx_splash.bmp'
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   599
                 ).
2905
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   600
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   601
        usedCompiler = 'bcc' ifTrue:[
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   602
            files := files , #( 
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   603
                        'librun/objbc/librun.dll'
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   604
                        'support/win32/borland/cs3245.dll' 
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   605
                        'support/win32/X11.dll'
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   606
                        'support/win32/Xext.dll'
2916
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   607
                        'lib/bc/librun.lib'
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   608
                        'lib/bc/cs32i.lib'
2905
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   609
                    ).
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   610
        ].
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   611
        usedCompiler = 'vc' ifTrue:[
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   612
            files := files , #( 
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   613
                        'librun/objvc/librun.dll'
2916
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   614
                        'lib/vc/librun.lib'
2905
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   615
                    ).
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
   616
        ].
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   617
        usedCompiler = 'tcc' ifTrue:[
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   618
            files := files , #( 
2916
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   619
                        'librun/objvc/librun.dll'   "/ linkage is against vc version!!
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   620
                        'lib/vc/librun.lib'
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   621
                    ).
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   622
        ].
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   623
        usedCompiler = 'lcc' ifTrue:[
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   624
            files := files , #( 
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   625
                        'librun/objvc/librun.dll'   "/ linkage is against vc version!!
59c84eca29fd lcc support
Claus Gittinger <cg@exept.de>
parents: 2914
diff changeset
   626
                        'lib/vc/librun.lib'
2911
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   627
                    ).
e12e4a47cfaa changed:
Claus Gittinger <cg@exept.de>
parents: 2909
diff changeset
   628
        ].
2918
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   629
        usedCompiler = 'mingw' ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   630
            files := files , #( 
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   631
                        'librun/objmingw/librun.dll'   "/ linkage is against vc version!!
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   632
                        'lib/mingw/librun.lib'
2918
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   633
                    ).
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   634
        ].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   635
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   636
        files := #(
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   637
                    'librun/main.c'
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   638
                    'librun/librun.so'
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   639
                )
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   640
    ].
2677
e2c24a1be97f changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
   641
    files := files asOrderedCollection.
e2c24a1be97f changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
   642
e2c24a1be97f changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
   643
    OperatingSystem isMSWINDOWSlike ifTrue:[
e2c24a1be97f changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
   644
        projectDefinitionClass applicationIconFileName notNil ifTrue:[
2678
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   645
            files add:('projects/smalltalk/',projectDefinitionClass applicationIconFileName,'.ico')
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   646
        ].
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   647
        projectDefinitionClass splashFileName notNil ifTrue:[
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   648
            files add:('projects/smalltalk/',projectDefinitionClass splashFileName,'.bmp')
cca2788228ad added: #copySupportFilesForExecution
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
   649
        ].
2677
e2c24a1be97f changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2673
diff changeset
   650
    ].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   651
2914
745b9c77b599 changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   652
    files do:[:relativePath |
745b9c77b599 changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   653
        (mySTXTopDirectory / relativePath) exists ifTrue:[
745b9c77b599 changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   654
            ((buildDirectory / 'stx' / relativePath) exists
745b9c77b599 changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   655
            and:[ (mySTXTopDirectory / relativePath) fileSize = (buildDirectory / 'stx' / relativePath) fileSize
745b9c77b599 changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   656
            and:[ (mySTXTopDirectory / relativePath) modificationTime < (buildDirectory / 'stx' / relativePath) modificationTime
2684
80fe0f753fd8 changed: #copySupportFilesForLinkage
sr
parents: 2683
diff changeset
   657
            "/ and:[ (mySTXTopDirectory / dllRelativePath) sameContentsAs:(targetBuildDir / dllRelativePath) ]
80fe0f753fd8 changed: #copySupportFilesForLinkage
sr
parents: 2683
diff changeset
   658
            ]]) ifFalse:[
2914
745b9c77b599 changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   659
                (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory.
745b9c77b599 changed: #copySupportFilesForLinkage
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   660
                (mySTXTopDirectory / relativePath) copyTo:(buildDirectory / 'stx' / relativePath).    
2684
80fe0f753fd8 changed: #copySupportFilesForLinkage
sr
parents: 2683
diff changeset
   661
            ]
80fe0f753fd8 changed: #copySupportFilesForLinkage
sr
parents: 2683
diff changeset
   662
        ] ifFalse:[
2971
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   663
"/ does not really help: objbc/librun.lib does not work with MSVC and vice versa...
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   664
"/            ((relativePath = 'librun/objvc/librun.dll')
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   665
"/            and:[ (mySTXTopDirectory / 'librun/objbc/librun.dll') exists ])ifTrue:[
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   666
"/                stdErr nextPutLine:('Warning: using alternative librun from objbc (Borland version)...'). 
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   667
"/                (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory.
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   668
"/                (mySTXTopDirectory / 'librun/objbc/librun.dll') copyTo:(buildDirectory / 'stx' / relativePath).    
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   669
"/            ] ifFalse:[
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   670
"/                ((relativePath = 'librun/objbc/librun.dll')
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   671
"/                and:[ (mySTXTopDirectory / 'librun/objvc/librun.dll') exists ])ifTrue:[
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   672
"/                    stdErr nextPutLine:('Warning: using alternative librun from objvc (MSVC version)...'). 
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   673
"/                    (buildDirectory / 'stx' / relativePath) directory recursiveMakeDirectory.
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   674
"/                    (mySTXTopDirectory / 'librun/objvc/librun.dll') copyTo:(buildDirectory / 'stx' / relativePath).    
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   675
"/                ] ifFalse:[
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   676
                    self error:'Missing file: ',relativePath printString mayProceed:true.
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   677
"/                ]
e10937c35748 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   678
"/            ]
2684
80fe0f753fd8 changed: #copySupportFilesForLinkage
sr
parents: 2683
diff changeset
   679
        ].
2614
Claus Gittinger <cg@exept.de>
parents: 2613
diff changeset
   680
    ].
2873
Claus Gittinger <cg@exept.de>
parents: 2868
diff changeset
   681
2918
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   682
    "Modified: / 05-09-2012 / 16:26:25 / cg"
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   683
!
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   684
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   685
createHeaderFileFor:aClass in:packageTargetDir
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   686
    |instVarList classInstVarList classVarList bindings superclassFilename
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   687
     template file newContents oldContents|
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   688
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   689
    instVarList := StringCollection new.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   690
    aClass instVarNames do:[:v |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   691
        instVarList add:('OBJ %1;' bindWith:v)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   692
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   693
    classInstVarList := StringCollection new.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   694
    aClass class instVarNames do:[:v |
2961
f28135198d42 halts changed to breakpoint
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
   695
    "/ (v includes:$_) ifTrue:[self halt].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   696
        classInstVarList add:('OBJ %1;' bindWith:v)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   697
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   698
    classVarList := StringCollection new.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   699
    aClass classVarNames do:[:v |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   700
        classVarList add:('extern OBJ %1_%2;' bindWith:aClass name with:v)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   701
    ].
2614
Claus Gittinger <cg@exept.de>
parents: 2613
diff changeset
   702
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   703
    bindings := Dictionary new.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   704
    bindings at:'ClassName' put:aClass name. 
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   705
    aClass superclass isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   706
        bindings at:'SuperclassName' put:'-'. 
2852
a3007ba3b216 changed:
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
   707
        bindings at:'SuperclassFileInclude' put:''.
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   708
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   709
        bindings at:'SuperclassName' put:aClass superclass name. 
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   710
        bindings at:'SuperclassFileName' put:(superclassFilename := Smalltalk fileNameForClass:aClass superclass).
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   711
        bindings at:'SuperclassFileInclude' put:('#include "%1.STH"' bindWith:superclassFilename).
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   712
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   713
    bindings at:'InstVarList' put:instVarList asString. 
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   714
    bindings at:'ClassVarList' put:classVarList asString. 
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   715
    bindings at:'ClassInstVarList' put:classInstVarList asString. 
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   716
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   717
    template := 
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   718
'/* This file was generated by ProjectBuilder. */
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   719
/* !!!!!!!! Do not change by hand !!!!!!!! */
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   720
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   721
/* Class: %(ClassName) */
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   722
/* Superclass: %(SuperclassName) */
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   723
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   724
%(SuperclassFileInclude)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   725
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   726
/* INDIRECTGLOBALS */
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   727
#ifdef _HEADER_INST_
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   728
%(InstVarList)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   729
#endif /* _HEADER_INST_ */
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   730
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   731
#ifdef _HEADER_CLASS_
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   732
%(ClassVarList)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   733
#endif /* _HEADER_CLASS_ */
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   734
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   735
#ifdef _HEADER_CLASSINST_
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   736
%(ClassInstVarList)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   737
#endif /* _HEADER_CLASSINST_ */
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   738
'.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   739
    newContents := template bindWithArguments:bindings.
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   740
    file := packageTargetDir asFilename / ((Smalltalk fileNameForClass:aClass),(self suffixForHeaderFiles)).
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   741
    (file exists not
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   742
    or:[ (oldContents := file contents) ~= newContents ]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   743
        file contents: newContents.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   744
    ].
2852
a3007ba3b216 changed:
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
   745
a3007ba3b216 changed:
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
   746
    "Modified: / 15-08-2011 / 14:58:46 / cg"
2614
Claus Gittinger <cg@exept.de>
parents: 2613
diff changeset
   747
!
Claus Gittinger <cg@exept.de>
parents: 2613
diff changeset
   748
3042
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   749
generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:projectDefinitionClass
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   750
    |fullPathName|
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   751
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   752
    projectDefinitionClass forEachFileNameAndGeneratedContentsDo:[:fileName :fileContents |
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   753
        fullPathName := packageTargetDir construct:fileName.
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   754
        fullPathName directory exists ifFalse:[
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   755
            "take care for files like 'autopackage/default.apspec'"
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   756
            fullPathName directory makeDirectory.
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   757
        ].
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   758
        (fullPathName exists
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   759
         and:[ fullPathName contents = fileContents ]) ifFalse:[
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   760
            fullPathName contents:fileContents.
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   761
        ].
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   762
    ].    
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   763
!
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   764
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   765
generateSourceFiles
2964
44fd164ad253 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2961
diff changeset
   766
    (self isLocalBuild not and:[ sourceCodeManager notNil ])  ifTrue:[
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   767
        "/ check out / generate files there
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   768
        self generateSourceFilesByCheckingOutUsing:sourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   769
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   770
        "/ local build
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   771
        "/ fileout the project
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   772
        self generateSourceFilesByFilingOut
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   773
    ]
2599
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   774
!
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
   775
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   776
generateSourceFilesByCheckingOutUsing:aSourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   777
    "/ will no longer be needed/supported
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   778
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   779
    |repository stxRepository module directory|
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   780
2868
8a4d46fd157c changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents: 2861
diff changeset
   781
    self breakPoint:#cg.
8a4d46fd157c changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents: 2861
diff changeset
   782
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   783
    "/ check out / generate files there
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   784
    repository := (aSourceCodeManager repositoryNameForModule:module) ifNil:[aSourceCodeManager repositoryName].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   785
    stxRepository := aSourceCodeManager repositoryName.
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   786
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   787
    (buildDirectory construct:'stx') exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   788
        (module ~= 'stx') ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   789
            OperatingSystem
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   790
                executeCommand:('cvs -d ',stxRepository,' co stx')
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   791
                inputFrom:nil
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   792
                outputTo:Transcript
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   793
                errorTo:Transcript
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   794
                inDirectory:buildDirectory
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   795
                onError:[:status| self error:'cvs update stx failed'].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   796
        ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   797
    ].
2635
8b62bd023558 namespace change
Claus Gittinger <cg@exept.de>
parents: 2634
diff changeset
   798
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   799
    ((buildDirectory construct:module) construct:'CVS') exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   800
        OperatingSystem
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   801
            executeCommand:('cvs -d ',repository,' co -l ',directory)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   802
            inputFrom:nil
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   803
            outputTo:Transcript
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   804
            errorTo:Transcript
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   805
            inDirectory:buildDirectory
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   806
            onError:[:status| self error:'cvs update failed'].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   807
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   808
    OperatingSystem
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   809
        executeCommand:'cvs upd -d'
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   810
        inputFrom:nil
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   811
        outputTo:Transcript
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   812
        errorTo:Transcript
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   813
        inDirectory:(buildDirectory construct:module)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   814
        onError:[:status| self error:'cvs update failed'].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   815
self halt.
2868
8a4d46fd157c changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents: 2861
diff changeset
   816
8a4d46fd157c changed: #generateSourceFilesByCheckingOutUsing:
Claus Gittinger <cg@exept.de>
parents: 2861
diff changeset
   817
    "Modified: / 29-12-2011 / 14:02:56 / cg"
2600
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   818
!
bfde5434dcdd added:5 methods
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   819
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   820
generateSourceFilesByFilingOut
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   821
    "/ local build
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   822
    "/ fileout the project
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   823
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   824
    (package module ~= 'stx') ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   825
        (buildDirectory / package module) makeDirectory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   826
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   827
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   828
    "/ file out the package(s) which are to be built
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   829
    ((Array with:package))
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   830
    do:[:eachPackageToFileout |
2981
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   831
        |packageId packageModule packageDirectory packageTargetDir packageDef extSource|
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   832
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   833
        packageId := eachPackageToFileout asPackageId.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   834
        packageModule := packageId module.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   835
        packageDirectory := packageId directory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   836
        packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   837
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   838
        packageDef := packageId projectDefinitionClass.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   839
        (packageDef compiled_classNames_common ,
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   840
        packageDef compiled_classNamesForPlatform) do:[:eachClassName |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   841
            |cls fileName newSource|
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   842
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   843
            cls := Smalltalk classNamed:eachClassName.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   844
            self assert:cls isLoaded.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   845
            fileName := (Smalltalk fileNameForClass:cls),'.st'.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   846
            fileName := packageTargetDir asFilename construct:fileName.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   847
            fileName exists ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   848
                newSource := String streamContents:[:s | cls fileOutOn:s withTimeStamp:false].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   849
                newSource = fileName contentsAsString ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   850
                    fileName contents:newSource
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   851
                ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   852
            ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   853
                cls fileOutIn:packageTargetDir withTimeStamp:false
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   854
            ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   855
        ].
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   856
2981
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   857
        packageDef hasExtensionMethods ifTrue:[
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   858
            extSource := 
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   859
                String streamContents:[:s |
2985
57ed21d4e926 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2984
diff changeset
   860
                    s nextPutAll:('"{ Package: ''%1'' }" !!\\' bindWith:packageDef package) withCRs.
57ed21d4e926 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2984
diff changeset
   861
2981
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   862
                    packageDef extensionMethods do:[:eachMethod |
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   863
                        eachMethod mclass fileOutMethod:eachMethod on:s
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   864
                    ].
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   865
                ].
2987
f3895651ef5f class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2986
diff changeset
   866
            extSource isWideString ifTrue:[
f3895651ef5f class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2986
diff changeset
   867
                extSource := ( '"{ Encoding: utf8 }"' , Character cr asString, Character cr asString, extSource).
f3895651ef5f class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2986
diff changeset
   868
                extSource := extSource utf8Encoded.
f3895651ef5f class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2986
diff changeset
   869
            ].
2985
57ed21d4e926 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2984
diff changeset
   870
            (packageTargetDir asFilename construct:'extensions.st') contents:extSource
2981
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   871
        ].
e61e4a6fb317 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2979
diff changeset
   872
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   873
"/        (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   874
"/            cls isPrivate ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   875
"/                cls isLoaded ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   876
"/                    self halt.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   877
"/                    cls autoload.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   878
"/                ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   879
"/                cls fileOutIn:packageTargetDir
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   880
"/            ]
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   881
"/        ].
3042
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   882
        self generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:projectDefinitionClass.
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   883
    ].
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   884
    self makeQuick ifFalse:[
3042
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   885
        "/ generate header files and build support files
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   886
        "/ in prerequisite packages...
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   887
        (projectDefinitionClass allPreRequisites)
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   888
        do:[:eachPackageToFileout |
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   889
            |packageId packageDef packageModule packageDirectory packageTargetDir|
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   891
            packageId := eachPackageToFileout asPackageId.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   892
            packageModule := packageId module.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   893
            packageDirectory := packageId directory.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   894
            packageTargetDir := (buildDirectory / packageModule / packageDirectory) recursiveMakeDirectory.
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   895
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   896
            packageDef := packageId projectDefinitionClass.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   897
            (packageDef compiled_classNames_common ,
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   898
            packageDef compiled_classNamesForPlatform) do:[:eachClassName |
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   899
                |cls|
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   900
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   901
                cls := Smalltalk classNamed:eachClassName.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   902
                "/ self assert:cls isLoaded.
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   903
                cls isNil ifTrue:[
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   904
                    stdErr nextPutLine:('Missing class: ',eachClassName, ' (not present in system. Warning only:subclasses of it will not be compiled)').
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   905
                ] ifFalse:[
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   906
                    cls isLoaded ifTrue:[    
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   907
                        self createHeaderFileFor:cls in:packageTargetDir
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   908
                    ]
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   909
                ].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   910
            ].
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   911
            self copyResourcesForPackage:eachPackageToFileout.
3042
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   912
            self generateBuildSupportFilesByFilingOutIn:packageTargetDir forDefinitionClass:packageDef.
7022b69410ab class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3041
diff changeset
   913
            (packageTargetDir / '.NOSOURCE') contents:'existence of this file suppresses compilation of st files'.
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   914
        ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   915
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   916
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   917
"/    stx_libbasic2 preRequisitesForBuilding#(#'stx:libbasic')
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   918
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   919
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   920
makeCommandOfCompiler:usedCompiler
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   921
    usedCompiler = 'bcc' ifTrue:[ 
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   922
        ^ 'bmake'.
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   923
    ].
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   924
    usedCompiler = 'vc' ifTrue:[ 
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   925
        ^ 'vcmake'. "/ compilerFlag := '-DUSEVC' 
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   926
    ].
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   927
    usedCompiler = 'lcc' ifTrue:[ 
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   928
        ^ 'lccmake'. "/ compilerFlag := '-DUSELCC' 
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   929
    ].
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   930
    usedCompiler = 'tcc' ifTrue:[ 
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   931
        ^ 'tccmake'. "/ compilerFlag := '-DUSELCC' 
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   932
    ].
2918
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
   933
    usedCompiler = 'mingw' ifTrue:[ 
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   934
        ^ 'mingwmake'.  "/ compilerFlag := '-DUSEMINGW' 
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   935
    ].
2989
fce70ea7d5d7 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2987
diff changeset
   936
    true "usedCompiler = 'gcc'" ifTrue:[ 
fce70ea7d5d7 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2987
diff changeset
   937
        ^ 'make'.       "/ compilerFlag := '-DUSEGCC' 
fce70ea7d5d7 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2987
diff changeset
   938
    ].
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   939
    self error:'unknown compiler specified'.
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   940
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   941
    "Created: / 03-09-2012 / 19:46:07 / cg"
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   942
!
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   943
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   944
makeWithOutputTo:stdOut errorTo:stdErr
3072
117522ff72bc class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3043
diff changeset
   945
    |module directory makeCommand forceArg|
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   946
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   947
    module := package module.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   948
    directory := package directory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   949
2680
3f2dbbd7743f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2678
diff changeset
   950
    makeCommand := ParserFlags makeCommand.
2895
2b939399b83b changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
   951
    usedCompiler isNil ifTrue:[
2b939399b83b changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
   952
        usedCompiler := ParserFlags usedCompiler.
2b939399b83b changed: #makeWithOutputTo:errorTo:
Claus Gittinger <cg@exept.de>
parents: 2873
diff changeset
   953
    ].
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
   954
    makeCommand := self makeCommandOfCompiler:usedCompiler.
3072
117522ff72bc class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3043
diff changeset
   955
    forceArg := ''.
117522ff72bc class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3043
diff changeset
   956
    
2852
a3007ba3b216 changed:
Claus Gittinger <cg@exept.de>
parents: 2845
diff changeset
   957
    "/ makeCommand := makeCommand, ' TOP=', mySTXTopDirectory pathName.
2680
3f2dbbd7743f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2678
diff changeset
   958
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   959
    OperatingSystem isUNIXlike ifTrue:[
3072
117522ff72bc class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3043
diff changeset
   960
        forceArg := ' FORCE='.
117522ff72bc class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3043
diff changeset
   961
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   962
        "/ generate the makefile first
2984
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   963
        self activityNotification:('sh %1/rules/stmkmf (in %2)' 
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   964
                    bindWith:mySTXTopDirectory pathName    
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
   965
                    with:(buildDirectory / module / directory)).
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   966
        OperatingSystem
2845
0d52c66fbc8e changed: #makeWithOutputTo:errorTo:
Stefan Vogel <sv@exept.de>
parents: 2844
diff changeset
   967
            executeCommand:('sh %1/rules/stmkmf' bindWith:mySTXTopDirectory pathName)
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   968
            inputFrom:nil
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   969
            outputTo:stdOut
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   970
            errorTo:stdErr
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   971
            inDirectory:(buildDirectory / module / directory)
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   972
            onError:[:status | self error:'make failed'].
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   973
    ].
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
   974
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   975
    projectDefinitionClass isLibraryDefinition ifTrue:[
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   976
        "/ generate the library
2969
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   977
        self activityNotification:(makeCommand,' classLibRule').
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   978
        OperatingSystem
3072
117522ff72bc class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3043
diff changeset
   979
            executeCommand:(makeCommand,' classLibRule',forceArg)
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   980
            inputFrom:nil
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   981
            outputTo:stdOut
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   982
            errorTo:stdErr
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   983
            inDirectory:(buildDirectory / module / directory)
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   984
            onError:[:status | self error:'make failed'].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   985
    ] ifFalse:[
2972
7db782e25d01 mingw build (unfinished)
Claus Gittinger <cg@exept.de>
parents: 2971
diff changeset
   986
        (self makeExeOnly) ifTrue:[
2969
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   987
            self activityNotification:(makeCommand,' exe').
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   988
            OperatingSystem
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   989
                "/ generate the executable
3072
117522ff72bc class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3043
diff changeset
   990
                executeCommand:(makeCommand,' exe',forceArg)
2969
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   991
                inputFrom:nil
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   992
                outputTo:stdOut
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   993
                errorTo:stdErr
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   994
                inDirectory:(buildDirectory / module / directory)
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   995
                onError:[:status | self error:'make failed'].
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
   996
2969
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   997
        ] ifFalse:[
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
   998
            "/ generate the self-installable package
2969
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
   999
            self activityNotification:(makeCommand,' ALL_NP').
2673
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1000
            OperatingSystem
2969
d03c40cd3fa5 fixes and more flyby helps
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
  1001
                executeCommand:(makeCommand,' ALL_NP')
2673
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1002
                inputFrom:nil
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1003
                outputTo:stdOut
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1004
                errorTo:stdErr
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1005
                inDirectory:(buildDirectory / module / directory)
2921
bea9c6bb6a90 class definition
Claus Gittinger <cg@exept.de>
parents: 2918
diff changeset
  1006
                onError:[:status | self error:'make failed'].
2673
100b4dd5c3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1007
        ]
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1008
    ]
2793
e03152b97cdd usevc/usebc handling
Claus Gittinger <cg@exept.de>
parents: 2741
diff changeset
  1009
3072
117522ff72bc class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 3043
diff changeset
  1010
    "Modified: / 28-01-2014 / 21:48:07 / cg"
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1011
!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
2905
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  1013
objDirForUsedCompiler
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1014
    ^ self objDirForUsedCompiler:usedCompiler
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1015
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1016
    "Created: / 20-08-2012 / 17:01:13 / cg"
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1017
!
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1018
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1019
objDirForUsedCompiler:usedCompiler
2918
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
  1020
    usedCompiler = 'gcc' ifTrue:[^ 'obj'].      "/ unix case
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
  1021
2905
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  1022
    usedCompiler = 'bcc' ifTrue:[^ 'objbc'].
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  1023
    usedCompiler = 'vc' ifTrue:[^ 'objvc'].
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1024
    usedCompiler = 'tcc' ifTrue:[^ 'objtcc'].
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1025
    usedCompiler = 'lcc' ifTrue:[^ 'objlcc'].
2918
Claus Gittinger <cg@exept.de>
parents: 2916
diff changeset
  1026
    usedCompiler = 'mingw' ifTrue:[^ 'objmingw'].
2961
f28135198d42 halts changed to breakpoint
Claus Gittinger <cg@exept.de>
parents: 2958
diff changeset
  1027
    self halt:'please add compiler here'.
2905
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  1028
    ^ 'objbc'
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  1029
2909
Claus Gittinger <cg@exept.de>
parents: 2905
diff changeset
  1030
    "Created: / 03-09-2012 / 19:55:34 / cg"
2905
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  1031
!
d02db91a0938 visual-c building
Claus Gittinger <cg@exept.de>
parents: 2898
diff changeset
  1032
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1033
recursiveCopyDirectoryForBuild:subdir
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1034
    |targetDir|
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1035
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1036
    targetDir := buildDirectory / 'stx' / subdir.
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1037
    targetDir exists ifFalse:[
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1038
        targetDir makeDirectory.
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1039
    ].
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1040
    (mySTXTopDirectory / subdir) directoryContentsAsFilenamesDo:[:eachFile |
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1041
        eachFile recursiveCopyTo:(targetDir construct:eachFile baseName)
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1042
    ].
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1043
    self activityNotification:nil
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1044
!
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1045
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1046
setupBuildDirectory
2984
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  1047
    self activityNotification:('Building in %1' bindWith:buildDirectory pathName).
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  1048
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1049
    buildDirectory exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1050
        buildDirectory recursiveMakeDirectory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1051
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1052
    (buildDirectory / 'stx') exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1053
        (buildDirectory / 'stx') makeDirectory.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1054
    ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1055
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1056
    self copyDirectoryForBuild:'include'.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1057
    self copyDirectoryForBuild:'rules'.
2984
bfb6db857ea8 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2981
diff changeset
  1058
2683
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1059
    OperatingSystem isUNIXlike ifTrue:[
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1060
        self recursiveCopyDirectoryForBuild:'configurations'.
ff39502be3a2 some tries for UNIX - unfinished
sr
parents: 2680
diff changeset
  1061
    ]
2611
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
  1062
!
Claus Gittinger <cg@exept.de>
parents: 2600
diff changeset
  1063
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1064
validateBuildDirectoryIsPresent
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1065
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1066
    ^ self.
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1067
2644
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1068
"/    [
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1069
"/        |default directoryIsOKForMe stc |
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1070
"/
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1071
"/        default := (buildDirectory ?
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1072
"/                          PreviousBuildDirectory)
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1073
"/                          ifNil:[ UserPreferences current buildDirectory].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1074
"/
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1075
"/        buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:'
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1076
"/                                 default:default.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1077
"/
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1078
"/        buildDirectory isEmptyOrNil ifTrue:[^ self].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1079
"/        buildDirectory := buildDirectory asFilename.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1080
"/        directoryIsOKForMe := true.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1081
"/
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1082
"/        buildDirectory exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1083
"/            Dialog warn:(self classResources string:'Work directory %1 does not exist.' with:buildDirectory).
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1084
"/            directoryIsOKForMe := false.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1085
"/        ] ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1086
"/            (buildDirectory construct:'stx') exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1087
"/                Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.').
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1088
"/                directoryIsOKForMe := false.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1089
"/            ] ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1090
"/                stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc'].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1091
"/                (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1092
"/                    Dialog warn:(self classResources stringWithCRs:'Work directory must contain an stc compiler in the stx/stc subDirectory.').
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1093
"/                    directoryIsOKForMe := false.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1094
"/                ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1095
"/                ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1096
"/                    Dialog warn:(self classResources stringWithCRs:'Work directory must have had a make run before (for include files to exists).').
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1097
"/                    directoryIsOKForMe := false.
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1098
"/                ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1099
"/            ]
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1100
"/        ].
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1101
"/        directoryIsOKForMe
Claus Gittinger <cg@exept.de>
parents: 2635
diff changeset
  1102
"/    ] whileFalse
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
! !
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
!ProjectBuilder class methodsFor:'documentation'!
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
2896
6ed90332dbda changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  1107
version
6ed90332dbda changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  1108
    ^ '$Header$'
6ed90332dbda changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  1109
!
6ed90332dbda changed: #copyDLLsForLinkage
Claus Gittinger <cg@exept.de>
parents: 2895
diff changeset
  1110
2596
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
version_CVS
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
    ^ '$Header$'
876679f78999 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
! !
2958
d842f4a91d44 class: Tools::ProjectBuilder
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  1114