This repository was archived by the owner on Nov 3, 2021. It is now read-only.
File tree 3 files changed +33
-12
lines changed
3 files changed +33
-12
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ repl: install shadow-cljs-repl-app
10
10
test-refresh : install shadow-cljs-watch-test-autorun
11
11
test : install echo-testing shadow-cljs-test
12
12
13
+ # Build a binary for FreeBSD using `make release-for-os` on a FreeBSD system.
14
+ bin-for-os : install build pkg-for-os
15
+ release-for-os : install test bin-for-os test-bin
16
+
13
17
14
18
# ## Clojure ###
15
19
67
71
--out-path ./target/pkg \
68
72
./target/hello.js
69
73
74
+ pkg-for-os :
75
+ @echo " building binary ..."
76
+ @./node_modules/.bin/pkg \
77
+ -c package.json \
78
+ -t node10 \
79
+ --output ./target/hello \
80
+ ./target/hello.js
81
+
70
82
pkg-renamed : pkg
71
83
@mkdir -p ./target/bin-alpine
72
84
@mv ./target/pkg/hello-alpine ./target/bin-alpine/hello
Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ Development:
61
61
* ` make test-refresh ` -- Run project tests and watch for changes.
62
62
* ` make test ` -- Run project tests.
63
63
64
+ To build a binary for FreeBSD, set up a development environment and run `make
65
+ release-for-os` on a FreeBSD system, with resulting binary at ` ./target/hello`.
66
+
67
+
64
68
Production:
65
69
66
70
* After running ` make ` , find redistributable binaries in ` ./target/bin-*/ ` .
Original file line number Diff line number Diff line change @@ -40,18 +40,23 @@ assert_equal() {
40
40
resolve_exe () {
41
41
# Resolve path to project-built binary based on the present platform.
42
42
43
- case " $OSTYPE " in
44
- linux* )
45
- EXE=" $TARGET /bin-linux/$NAME "
46
- ;;
47
- darwin* )
48
- EXE=" $TARGET /bin-mac/$NAME "
49
- ;;
50
- * )
51
- echo " $PROG : unsupported OS: $OSTYPE " >&2
52
- return 2
53
- ;;
54
- esac
43
+ if [ -e " $TARGET /$NAME " ]; then
44
+ # Prefer single binary, if found, which is a build for current OS.
45
+ EXE=" $TARGET /$NAME "
46
+ else
47
+ case " $OSTYPE " in
48
+ linux* )
49
+ EXE=" $TARGET /bin-linux/$NAME "
50
+ ;;
51
+ darwin* )
52
+ EXE=" $TARGET /bin-mac/$NAME "
53
+ ;;
54
+ * )
55
+ echo " $PROG : unsupported OS: $OSTYPE " >&2
56
+ return 2
57
+ ;;
58
+ esac
59
+ fi
55
60
56
61
echo " Testing binary: $EXE "
57
62
}
You can’t perform that action at this time.
0 commit comments