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