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