Commit 73d0412a authored by Martin Ruckert's avatar Martin Ruckert

moving mmixlib and visualstudio to separate repositories

parent 4b31f628
Configuration
-------------
To get a working mmix library,
you need the file libconfig.h and linimport.h
For the plain mmix simulator and assembler,
you can just copy libconfig.plain to libconfig.h
and libimport.plain to libimport.h
If you want to modify these files you should see
CONFIGURE.TXT for further explanations.
MMIXware
--------
You need a subdirectory of this direcory called mmixware
with the (latest) distribution of the mmixware sources.
You can get these from the MMIX homepage (mmix.cs.hm.edu).
Then you should create abstime.h in the mmixware directory.
Change into this directory and run "make abstime.h"
this will do
ctangle abstime.c to create the c file then compile it
and run it redirecting its output to abstime.h.
Making the mmix library
-----------------------
Copy boilerplate.w and abstime.h from the mmixware subdirectory
into the mmixlib directory.
Under Unix, a simple make should suffice.
- It will run ctangle on mmix-sim.w with the mmixlib.ch change file.
This will produce multiple .c and .h files containing the mmix sources.
- It will run ctangle on mmixal.w with the mmixallib.ch change file.
This will produce two more .c files containing the mmix sources.
- It will run ctangle on mmix-arith.w and mmix-io.w.
This will produce mmix-arith.c and mmix-io.c.
Then all the C files together with libname.c and libbase.c will be compiled
and packed into a library.
Making mmix and mmixal
----------------------
The individual pieces from the library can be recombined to get
a running simulator or a running assembler.
Look at the files mmix-sim.c and mmixal.c also produced
by the above run of ctangle. These files contain
main programms that call the various functions from the library.
You can compile them and link them against the mmix library just
created and you get a simulator and an assembler.
You are however free to modify these main programs and
produce variations of the MMIX software. In this case you should
give your executable a different name to avoid confusion with
the original MMIXware.
Windows and Visual Studio
-------------------------
To build and use the library under windows with the Visual Studio,
you need a working ctangle.exe file. Download it from the MMIX homepage
(or from www.literateprogramming.com).
You have to make sure the path to this ctangle.exe is on the search path
of visual studio (Try Tools->Options->Projects ans Solutions-> VC Directories)
or a similar path depending on the version of Visual Studio. Then you
should be able to open the solution file and build the library.
# the directory with the MMIXware sources
MMIXWARE=./mmixware
#INCLDIR=-I ../../vmb/src/util -I ../../vmb/src/vmbmmixlib
#LIBDIR=-L. -L../../vmb/src/util -L../../vmb/src/vmbmmixlib
#INCLDIR=-I
#LIBDIR=-L.
LIBSIM= libboot.c libfinal.c libload.c libprint.c libstats.c \
libcommand.c libinit.c libmem.c libprofile.c libtrace.c \
libdtrap.c libinteract.c libmmget.c libshowbreaks.c libglobals.c \
libdump.c liblibfinal.c libmmput.c libshowline.c libstdin.c \
libfetch.c liblibinit.c libperform.c libsoption.c
LIBAL= libmmixal.c libalerror.c
LIBH= libarith.h libtype.h mmix-io.h
LIBSRC= libname.c libbase.c
LIBOBJ= $(LIBSIM:.c=.o) $(LIBAL:.c=.o) $(LIBSRC:.c=.o) mmix-arith.o mmix-io.o
CC= gcc
CFLAGS= -Wall -ggdb -O0 $(INCLDIR) $(LIBDIR)
AR = ar
ARFLAGS = cru
RANLIB = ranlib
all: libmmix.a mmix-sim.c mmixal.c
libbase.o: libbase.c libbase.h libconfig.h
%.o : %.c abstime.h mmixlib.h $(LIBH)
boilerplate.w: $(MMIXWARE)/boilerplate.w
cp $< $@
abstime.h: $(MMIXWARE)/abstime.h
cp $< $@
$(MMIXWARE)/abstime:
$(MAKE) -C $(MMIXWARE) abstime
$(MMIXWARE)/abstime.h: $(MMIXWARE)/abstime
$(MMIXWARE)/abstime > $(MMIXWARE)/abstime.h
mmix-arith.c: boilerplate.w $(MMIXWARE)/mmix-arith.w
ctangle $(MMIXWARE)/mmix-arith.w
mmix-io.c: boilerplate.w $(MMIXWARE)/mmix-io.w libio.ch
ctangle $(MMIXWARE)/mmix-io.w libio.ch
$(LIBAL): boilerplate.w $(MMIXWARE)/mmixal.w mmixallib.ch
ctangle $(MMIXWARE)/mmixal.w mmixallib.ch
$(LIBSIM) $(LIBH) mmix-sim.c: boilerplate.w $(MMIXWARE)/mmix-sim.w mmixlib.ch libconfig.h libimport.h
ctangle $(MMIXWARE)/mmix-sim.w mmixlib.ch
libmmix.a: abstime.h $(LIBOBJ)
rm -f $@
$(AR) $(ARFLAGS) $@ $(LIBOBJ)
$(RANLIB) $@
mmix: libmmix.a mmix-sim.c
$(CC) $(CFLAGS) mmix-sim.c -L. -lmmix -o mmix
mmixcpu: libmmix.a mmix-vmb.c
$(CC) $(CFLAGS) mmix-vmb.c -lmmix -lvmbmmix -lvmb -lpthread -o mmixcpu
mmixal: libmmix.a mmixal.c
$(CC) $(CFLAGS) mmixal.c -L. -lmmix -o mmixal
.PHONY: TAGS
TAGS:
etags *.c *.h *.ch
clean:
rm -f *.o
rm -f $(LIBSIM) $(LIBH) $(LIBAL) mmix-arith.c mmix-io.c
rm -f *~ *.tmp
rm -f libmmix.a mmix
rm -f mmix-sim.c mmixal.c
This directory contains
changefiles and
supplementary source and header files
to create an MMIX library.
The functions composing the library can be
be used to recreate the mmix simulator and
mmixal assembler.
The main purpose of the library, however,
is the reconfiguration of the individual
pieces and the reasseablage of the pieces
to create and experiment with variations
of the original MMIX simulator and assembler.
It ist further possible to incorporate these
pieces into larger programms (editors, debuggers,
development environments, ... ) by linking
these programs against a properly configured
library.
see also:
CONFIGURE.TXT
INSTALL.TXT
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="abstime"
ProjectGUID="{D49D454B-0839-4606-850D-03A6231DB2DA}"
RootNamespace="abstime"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
Description="build abstime.c"
CommandLine="ctangle mmixware\abstime.w abstime.c"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Generate abstime.h"
CommandLine="$(OutDir)\abstime.exe &gt; $(InputDir)\abstime.h"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
Description="build abstime.c"
CommandLine="ctangle mmixware\abstime.w abstime.c"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Generate abstime.h"
CommandLine="$(OutDir)\abstime.exe &gt; $(SolutionDir)\abstime.h"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\abstime.c"
>
</File>
<File
RelativePath=".\abstime.w"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
@x
@<Stuff for \CEE/ preprocessor@>@;
typedef enum{@+false,true@+} bool;
@<Tetrabyte and octabyte type definitions@>@;
@<Other type definitions@>@;
@<Global variables@>@;
@<Subroutines@>
@y
@<Stuff for \CEE/ preprocessor@>@;
#pragma warning(disable : 4146 4018 4244 4267)
#include "libconfig.h"
typedef enum{@+false,true@+} bool;
@<Tetrabyte and octabyte type definitions@>@;
@<Other type definitions@>@;
@<Global variables@>@;
#include "libimport.h"
@<Subroutines@>
@z
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="customizecpu"
ProjectGUID="{97BF3001-ABEA-4190-884A-E846DB460ABE}"
RootNamespace="customizecpu"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine=""
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine=""
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\mmixlib\libconfig.h"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\mmixlib\libconfig.cpu"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="copy libconfig.cpu to libconfig.h"
CommandLine="copy $(InputDir)libconfig.cpu $(InputDir)libconfig.h"
Outputs="$(InputDir)libconfig.h"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="copy libconfig.cpu to libconfig.h"
CommandLine="copy $(InputDir)libconfig.cpu $(InputDir)libconfig.h"
Outputs="$(InputDir)libconfig.h"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\mmixlib\libimport.h"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\mmixlib\libimport.cpu"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
<