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