Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# jversion-x.h default is in repo
# jversion.h is your local edit copy and is not in repo
jsrc/jversion.h
build

# unix
*.o
Expand All @@ -17,6 +18,7 @@ jsrc/jversion.h
**/jconsole/**/
**/jdll/**/
**/tsdll/**/
**/*~

# windows - need to run with different versions of vs
# following files are in repo for vs2013
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# jsource
J engine source mirror

At the time when I forked this project, building J was needlessly cumbersome and only built from hard-coded directories.
My patch made the build much smoother without any hard-coded directories.

The J team never responded to my pull request so I keep this here so I don't lose my build work.
2 changes: 0 additions & 2 deletions make/build_all.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
# build all binaries
cd ~
. jvars.sh

$jmake/install.sh

Expand Down
2 changes: 0 additions & 2 deletions make/build_jconsole.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
# $1 is j32 or j64
cd ~
. jvars.sh

common=" -fPIC -O1 -Wextra -Wno-unused-parameter "

Expand Down
2 changes: 0 additions & 2 deletions make/build_jconsolewin.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
# $1 is j32 or j64
cd ~
. jvars.sh

common=" -fPIC -O1 -Wextra "

Expand Down
2 changes: 0 additions & 2 deletions make/build_jdll.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
# $1 is j32 or j64
cd ~
. jvars.sh

# gcc 5 vs 4 - killing off linux asm routines (overflow detection)
# new fast code uses builtins not available in gcc 4
Expand Down
2 changes: 0 additions & 2 deletions make/build_libj.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
# $1 is j32 or j64
cd ~
. jvars.sh

# gcc 5 vs 4 - killing off linux asm routines (overflow detection)
# new fast code uses builtins not available in gcc 4
Expand Down
2 changes: 0 additions & 2 deletions make/build_tsdll.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
# $1 is j32 or j64
cd ~
. jvars.sh

common=" -fPIC -O1 -Werror -Wextra -Wno-unused-parameter"

Expand Down
3 changes: 0 additions & 3 deletions make/domake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# run by build_jconsole and build_libj
# $1 is j32 or j64

cd ~
. jvars.sh

echo $TARGET
echo $COMPILE
echo $LINK
Expand Down
3 changes: 0 additions & 3 deletions make/domakewin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# run by build_jconsole and build_libj
# $1 is j32 or j64

cd ~
. jvars.sh

echo $TARGET
echo $COMPILE
echo $LINK
Expand Down
29 changes: 29 additions & 0 deletions make/install-opt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# install jbld folders - new install or a reinstall

OPT=/opt/J
ROOT=..

rm -fr $OPT
mkdir $OPT
mkdir $OPT/j32
mkdir $OPT/j64
cp -r $ROOT/build/j32/* $OPT/j32
cp -r $ROOT/build/j64/* $OPT/j64
cat <<EOF >$OPT/j32/bin/jhs
#!/bin/sh
jconsole ~addons/ide/jhs/core.ijs -js " init_jhs_'' "
EOF
cat <<EOF >$OPT/j64/bin/jhs
#!/bin/sh
jconsole ~addons/ide/jhs/core.ijs -js " init_jhs_'' "
EOF
chmod +x $OPT/j32/bin/jhs $OPT/j64/bin/jhs

echo "install complete"
echo ""
echo "$ROOT/license.txt"

cat $ROOT/license.txt
exit 0

9 changes: 0 additions & 9 deletions make/install.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#!/bin/bash
# install jbld folders - new install or a reinstall

cd ~
if [ ! -f jvars.sh ]; then
echo "~/jvars.sh must exist"
exit 1
fi

cd ~
. jvars.sh

rm -f -r $jbld
mkdir $jbld
mkdir $jbld/j32
Expand Down
6 changes: 4 additions & 2 deletions make/jvars.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# source shell script (read with . jvars.sh) so stuff is easy to find

# edit following if your install is not standard
jgit=~/gitdev/jsource # git jsource folder
jbld=~/jbld # test libraries and binaries will be put here
cd ..
jgit=$(pwd)
cd make
jbld=$jgit/build

# edit platform to build - linux darwin raspberry
jplatform=linux
Expand Down
26 changes: 26 additions & 0 deletions make/make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#

export jplatform=`uname |awk '{print tolower($0)}'`

cd ../jsrc
if [ ! -f jversion.h ]; then
sed -e "s/jplatform.*unknown/jplatform \"$jplatform/" jversion-x.h >$$
sed -e "s/jbuilder.*unknown/jbuilder \"`uname -n`/" $$ >jversion.h
rm $$
fi

cd ..
export jgit=$(pwd)
cd make
export jbld=$jgit/build

export j32=$jbld/j32/bin/jconsole
export j64=$jbld/j64/bin/jconsole
export j64avx="$jbld/j64/bin/jconsole -lib libjavx.so"
export jmake=$jgit/make

$jmake/install.sh
$jmake/clean.sh

$jmake/build_all.sh
$jmake/release.sh
63 changes: 23 additions & 40 deletions make/make.txt
Original file line number Diff line number Diff line change
@@ -1,57 +1,40 @@
how to build/test j32/64 for linux/darwin/raspberry/...
How to build/test j32/64 for linux/darwin/raspberry/...

$jplatform (set by jvars.sh) determines compiler/link flags

$jplatform is a simple name that implies OS and hardware

linux implies intel
darwin implies intel
raspberry implies linux/arm/little-endian

to support linux on arm big-endian you need to add support in
build_jconsole.sh,... for a new platform (perhaps named linux_arm_be)
Note: on a 64 bit linux system, the following packages will be needed:
gcc-multilib
libedit-dev

**************************************************************************
# commands are assumed to run in ~ and depend on jvars.sh
# In what follows $ROOT is the root directory of your J project

cd $ROOT/make
# make sure shell scripts are executable
chmod +x gitdev/jsource/make/*.sh

# copy jvars.sh to ~ (for finding things)
cp gitdev/jsource/make/jvars.sh .
cat jvars.sh
chmod +x *.sh

# read jvars.sh and edit as appropriate - other steps depend on jvars.sh
# Edit jplatform in file make.sh
# !!! edit platform to be appropriate for the system doing the builds !!!
# valid platforms are: linux darwin raspberry

# create clean build folders
. jvars.sh
$jmake/install.sh
./make.sh

# The above line builds the system into the $ROOT/build directory

# To install to /opt do:

sudo ./install-opt.sh

# ensure proper jsrc/jversion.h (jversion-x.h template)
# Set path to access J

# !!! makefiles do not have h file dependencies !!!
# after h file changes, run clean.sh to rm all *.o fles for clean build
$jmake/clean.sh
export PATH=/opt/J/j64/bin:$PATH

# build j64 binaries
$jmake/build_jconsole.sh j64
$jmake/build_libj.sh j64
$jmake/build_tsdll.sh j64
# To run jconsole

# test j64
$j64
load'gitdev/jsource/test/tsu.ijs'
...
RUN ddall
jconsole

# build/test j32 binaries the same way (j32 instead of j64)
# To run the browser based IDE

# build everything from scratch
$jmake/build_all.sh
jhs

# release clean builds to the repo release folder
. jvars.sh
$jmake/release.sh
# then go to the following URL on your browser:

http://127.0.0.1:65001/jijx
2 changes: 0 additions & 2 deletions make/release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash
# copy binaries to release folder
cd ~
. jvars.sh

mkdir -p $jgit/release/$jplatform/j32
rm -f $jgit/release/$jplatform/j32/*
Expand Down
2 changes: 2 additions & 0 deletions overview.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
For unix builds, see make/make.txt rather than this file.

examples assume ~/gitdev/jsource and builds in ~/jbld

put jsource anywhere (adjust examples etc.)
Expand Down