Configure linux environment to create new programs for Magic‐1 - retrotruestory/M1DEV GitHub Wiki
Doing a top-level "make" should build everything.
However, I probably have a few hard-coded paths in some portions of the makefiles.
On my machine, the path is: /usr/home/buzbee/workspace
Add the following to your shell environment (updated to your workspace/M1Dev location).
MINIXROOT=/home/buzbee/workspace/M1Dev/minix CROOT=/home/buzbee/workspace/M1Dev/root LCCLIBDIR=/home/buzbee/workspace/M1Dev/lib/lcc M1INCLUDE=/home/buzbee/workspace/M1Dev/non_minix/lcc_include M1BIN=/home/buzbee/workspace/M1Dev/bin MINIXLIB=/home/buzbee/workspace/M1Dev/root/usr/lib MINIXINCLUDE=/home/buzbee/workspace/M1Dev/root/usr/include M1LIB=/home/buzbee/workspace/M1Dev/non_minix/lib LCCDIR=/home/buzbee/workspace/M1Dev/lib/lcc LCCBINDIR=/home/buzbee/workspace/M1Dev/bin M1ROOT=/home/buzbee/workspace/M1Dev (and substitute /home/buzbee for whatever your home user name and location is) Add the following to your .profile: PATH=$PATH:/home/buzbee/workspace/M1Dev/bin In the file ~/.bashrc, I have the following lines: # Set up Magic-1 dev stuff export MINICOM='-o' export M1ROOT=~/workspace/M1Dev export M1BIN=${M1ROOT}/bin export PATH=${M1BIN}:"${PATH}" export M1INCLUDE=${M1ROOT}/non_minix/lcc_include export M1LIB=${M1ROOT}/non_minix/lib export LCCDIR=${M1ROOT}/lib/lcc export LCCLIBDIR=${M1ROOT}/lib/lcc export LCCBINDIR=${M1BIN} export MINIXROOT=${M1ROOT}/minix export CROOT=${M1ROOT}/root export MINIXINCLUDE=${CROOT}/usr/include export MINIXLIB=${CROOT}/usr/lib
From a new Ubuntu install, you will need to get gcc, flex, bison and some other tools that I've forgotten about.
The top-level make will yield many warnings which you can ignore, but will fail if some tools are missing.
Let me know if this helps.
...Bill
after "sudo apt-get install libncurses5-dev" and "sudo apt install gcc-multilib" i get it to work :)
after 'make' in /home/buzbee/workspace/M1Dev ... l_main.o: file not recognized: file format not recognized collect2: error: ld returned 1 exit status make[1]: *** [Makefile:90: m1_larn] Error 1 make[1]: Leaving directory '/home/buzbee/workspace/M1Dev/dual_apps/larn' make: *** [Makefile:23: all] Error 2
Yes - sorry, that is expected. I have been sloppy in writing Makefiles.
In the "dual_apps" section, binaries are built for both native Magic-1 operation and for x86 cross-development.
First the x86 app is built (I think), and then the Magic-1 app is built.
The Makefiles don't properly clean out the .o files in between, so what is happening here is that make sees an
existing .o file and believes it doesn't need to recompile it - so it's trying to link together x86 and Magic-1 .o files.
When building things in the dual_app section, I generally do a "make clean" prior to "make".
My Ubuntu build system is fast enough that I never bothered to update the Makefiles to do the right thing.
...Bill