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