Skip to content

Commit 613c9a6

Browse files
committed
remove toplevel items in Makefile
1 parent 6a02724 commit 613c9a6

File tree

4 files changed

+40
-33
lines changed

4 files changed

+40
-33
lines changed

Makefile

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ RUNTIME=jscomp/runtime
1717
STDLIB=jscomp/stdlib-402
1818
OTHERS=jscomp/others
1919

20-
world:
21-
@echo "Making compiler"
22-
$(MAKE) -B -C lib -j $(NPROCS) all
23-
$(MAKE) libs
24-
25-
libs:
26-
@echo "Making compiler finished"
27-
$(MAKE) -C jscomp/runtime -j $(NPROCS) all
28-
$(MAKE) -C jscomp/others -j $(NPROCS) all
29-
$(MAKE) -C $(STDLIB) -j $(NPROCS) all
20+
# world:
21+
# @echo "Making compiler"
22+
# $(MAKE) -B -C lib -j $(NPROCS) all
23+
# $(MAKE) libs
24+
25+
# libs:
26+
# @echo "Making compiler finished"
27+
# $(MAKE) -C jscomp/runtime -j $(NPROCS) all
28+
# $(MAKE) -C jscomp/others -j $(NPROCS) all
29+
# $(MAKE) -C $(STDLIB) -j $(NPROCS) all
3030

3131

3232
# TODO: sync up with

jscomp/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You need to have [bucklescript-playground](https://github.com/BuckleScript/buckl
2323
opam switch 4.02.3+buckle-master
2424
eval `opam config env`
2525
opam install camlp4 ocp-ocamlres
26-
(cd vendor/ocaml && ./configure -prefix `pwd` && make world)
26+
(cd vendor/ocaml && ./configure -prefix `pwd` && make world.opt)
2727
(cd jscomp && BS_RELEASE_BUILD=true BS_PLAYGROUND=../../bucklescript-playground node repl.js)
2828
```
2929

scripts/install.js

+19-17
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
// old compiler.ml
1212
// This will be run in npm postinstall, don't use too fancy features here
1313

14-
var child_process = require('child_process')
14+
var cp = require('child_process')
1515
var fs = require('fs')
1616
var path = require('path')
17-
var os = require('os')
17+
// var os = require('os')
1818

19-
var os_type = os.type()
19+
// var os_type = os.type()
2020
var root_dir = path.join(__dirname, '..')
2121
var lib_dir = path.join(root_dir, 'lib')
2222
var root_dir_config = { cwd: root_dir, stdio: [0, 1, 2] }
@@ -42,7 +42,7 @@ function provideNinja() {
4242
function build_ninja() {
4343
console.log('No prebuilt Ninja, building Ninja now')
4444
var build_ninja_command = "./configure.py --bootstrap"
45-
child_process.execSync(build_ninja_command, { cwd: ninja_source_dir, stdio: [0, 1, 2] })
45+
cp.execSync(build_ninja_command, { cwd: ninja_source_dir, stdio: [0, 1, 2] })
4646
fs.renameSync(path.join(ninja_source_dir, 'ninja'), ninja_bin_output)
4747
console.log('ninja binary is ready: ', ninja_bin_output)
4848
}
@@ -51,7 +51,7 @@ function provideNinja() {
5151
function test_ninja_compatible(binary_path) {
5252
var version;
5353
try {
54-
version = child_process.execSync(JSON.stringify(binary_path) + ' --version', {
54+
version = cp.execSync(JSON.stringify(binary_path) + ' --version', {
5555
encoding: 'utf8',
5656
stdio: ['pipe', 'pipe', 'ignore'] // execSync outputs to stdout even if we catch the error. Silent it here
5757
}).trim();
@@ -84,7 +84,7 @@ function provideNinja() {
8484
* raise an exception if not matched
8585
*/
8686
function matchedCompilerExn() {
87-
var output = child_process.execSync('ocamlc.opt -v', { encoding: 'ascii' })
87+
var output = cp.execSync('ocamlc.opt -v', { encoding: 'ascii' })
8888
if (output.indexOf("4.02.3") >= 0) {
8989
console.log(output)
9090
console.log("Use the compiler above")
@@ -102,7 +102,7 @@ function tryToProvideOCamlCompiler() {
102102
} catch (e) {
103103
console.log('Build a local version of OCaml compiler, it may take a couple of minutes')
104104
try {
105-
child_process.execFileSync(path.join(__dirname, 'buildocaml.sh'))
105+
cp.execFileSync(path.join(__dirname, 'buildocaml.sh'))
106106
} catch (e) {
107107
console.log(e.stdout.toString());
108108
console.log(e.stderr.toString());
@@ -140,7 +140,7 @@ function copyBinToExe() {
140140
*/
141141
function checkPrebuilt() {
142142
try {
143-
var version = child_process.execFileSync(path.join(lib_dir, 'bsc' + sys_extension), ['-v'])
143+
var version = cp.execFileSync(path.join(lib_dir, 'bsc' + sys_extension), ['-v'])
144144
console.log("checkoutput:", String(version))
145145
return copyBinToExe()
146146
} catch (e) {
@@ -150,17 +150,17 @@ function checkPrebuilt() {
150150
}
151151

152152
function buildLibsAndInstall(){
153-
child_process.execFileSync(ninja_bin_output, ["-t", "clean"], { cwd: path.join(root_dir, 'jscomp', 'runtime'), stdio: [0, 1, 2] , shell: false})
154-
child_process.execFileSync(ninja_bin_output, { cwd: path.join(root_dir, 'jscomp', 'runtime'), stdio: [0, 1, 2] , shell: false})
155-
child_process.execFileSync(ninja_bin_output, ["-t", "clean"], { cwd: path.join(root_dir, 'jscomp', 'others'), stdio: [0, 1, 2], shell: false})
156-
child_process.execFileSync(ninja_bin_output, { cwd: path.join(root_dir, 'jscomp', 'others'), stdio: [0, 1, 2], shell: false })
157-
child_process.execFileSync(ninja_bin_output, ["-t", "clean"], { cwd: path.join(root_dir, 'jscomp', 'stdlib-402'), stdio: [0, 1, 2], shell: false })
158-
child_process.execFileSync(ninja_bin_output, { cwd: path.join(root_dir, 'jscomp', 'stdlib-402'), stdio: [0, 1, 2], shell : false })
153+
cp.execFileSync(ninja_bin_output, ["-t", "clean"], { cwd: path.join(root_dir, 'jscomp', 'runtime'), stdio: [0, 1, 2] , shell: false})
154+
cp.execFileSync(ninja_bin_output, { cwd: path.join(root_dir, 'jscomp', 'runtime'), stdio: [0, 1, 2] , shell: false})
155+
cp.execFileSync(ninja_bin_output, ["-t", "clean"], { cwd: path.join(root_dir, 'jscomp', 'others'), stdio: [0, 1, 2], shell: false})
156+
cp.execFileSync(ninja_bin_output, { cwd: path.join(root_dir, 'jscomp', 'others'), stdio: [0, 1, 2], shell: false })
157+
cp.execFileSync(ninja_bin_output, ["-t", "clean"], { cwd: path.join(root_dir, 'jscomp', 'stdlib-402'), stdio: [0, 1, 2], shell: false })
158+
cp.execFileSync(ninja_bin_output, { cwd: path.join(root_dir, 'jscomp', 'stdlib-402'), stdio: [0, 1, 2], shell : false })
159159
console.log('Build finsihed')
160160
if(is_windows){
161161
build_util.install()
162162
} else {
163-
child_process.execSync(make + " install", root_dir_config)
163+
cp.execSync(make + " install", root_dir_config)
164164
}
165165
}
166166

@@ -175,12 +175,14 @@ function provideCompiler() {
175175
if (process.env.BS_TRAVIS_CI === "1") {
176176
console.log('Enforcing snapshot in CI mode')
177177
if (fs.existsSync(path.join(root_dir, 'jscomp', 'Makefile'))) {
178-
child_process.execSync("make -C jscomp force-snapshotml", root_dir_config)
178+
cp.execSync("make -C jscomp force-snapshotml", root_dir_config)
179179
} else {
180180
console.log("jscomp/Makefile is missing")
181181
}
182182
}
183-
child_process.execFileSync(ninja_bin_output, { cwd: lib_dir, stdio: [0, 1, 2] })
183+
// Note this ninja file only works under *nix due to the suffix
184+
// under windows require '.exe'
185+
cp.execFileSync(ninja_bin_output, { cwd: lib_dir, stdio: [0, 1, 2] })
184186

185187
}
186188
}

scripts/release.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/env node
22
//@ts-check
33

4+
// used as a unit of releasing
45
var path = require('path')
56
var fs = require('fs')
67
var cp = require('child_process')
7-
var root = path.join(__dirname,'..')
8-
var libJsDir = path.join(root,'lib','js')
9-
var jscompDir = path.join(root,'jscomp')
8+
var rootDir = path.join(__dirname,'..')
9+
var libJsDir = path.join(rootDir,'lib','js')
10+
var jscompDir = path.join(rootDir,'jscomp')
11+
1012
function run() {
1113

1214

@@ -25,8 +27,11 @@ function run() {
2527
{ cwd: jscompDir, encoding: 'utf8', stdio: [0, 1, 2] })
2628
cp.execSync(`BS_DEBUG=false make -j9 force-snapshotml`,
2729
{ cwd: jscompDir, encoding: 'utf8', stdio: [0, 1, 2] })
28-
cp.execSync(`make -j9 world`,
29-
{ cwd: root, stdio: [0, 1, 2] })
30+
cp.execSync('ninja', {cwd : path.join(rootDir,'lib'), stdio:[0,1,2]})
31+
cp.execSync('ninja -t clean && ninja', { cwd: path.join(rootDir, 'jscomp', 'runtime'), stdio: [0, 1, 2]})
32+
cp.execSync('ninja -t clean && ninja', { cwd: path.join(rootDir, 'jscomp', 'others'), stdio: [0, 1, 2]})
33+
cp.execSync('ninja -t clean && ninja', { cwd: path.join(rootDir, 'jscomp', 'stdlib-402'), stdio: [0, 1, 2]})
34+
3035

3136
}
3237
if(require.main === module){

0 commit comments

Comments
 (0)