Commit b5560c65 authored by Martin Ruckert's avatar Martin Ruckert
Browse files

geting things to run under linux

parent ecb64353
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 \
libdump.c liblibfinal.c libmmput.c libshowline.c \
libfetch.c liblibinit.c libperform.c libsoption.c \
libarith.h libtype.h
LIBOBJ= $(LIBSIM:.c=.o) mmix-arith.o libmmixal.o
CC= gcc
CFLAGS= -Wall
AR = ar
ARFLAGS = cru
RANLIB = ranlib
all: libmmix.a mmix-sim.c
%.o : %.c abstime.h mmixlib.h
boilerplate.w: mmix/boilerplate.w
cp $< $@
abstime.h: mmix/abstime.h
cp $< $@
mmix/abstime.h: mmix/abstime
$(MAKE) -C mmix abstime
mmix/abstime > mmix/abstime.h
mmix-arith.c: boilerplate.w mmix/mmix-arith.w
ctangle mmix/mmix-arith.w
libmmixal.c:
ctangle mmix/mmixal.w libmixal.ch libmmixal.c
$(LIBSIM) mmix-sim.c: boilerplate.w mmix/mmix-sim.w mmixlib.ch libconfig.h
ctangle mmix/mmix-sim.w mmixlib.ch
libmmix.a: $(LIBSIM) $(LIBOBJ)
rm -f $@
$(AR) $(ARFLAGS) $@ $(LIBOBJ)
$(RANLIB) $@
clean:
rm -f *.o
rm -f $(LIBSIM) mmix-arith.c libmmixal.c
rm -f *~
rm -f libmmix.a
rm -f mmix-sim.c
#ifndef LIBCONFIG_H
#define LIBCONFIG_H
#ifdef WIN32
#pragma warning(disable : 4996)
#endif
/* this is the error exit function */
#define panic(m) (fprintf(stderr,"Panic: %s!\n",m), exit(-1))
......@@ -23,7 +25,11 @@
#define store_exec_translation(virt,phys)
#define store_data_translation(virt,phys)
#ifdef WIN32
#define MMIX_DELAY(ms,d) Sleep(ms); d=ms
#else
#define MMIX_DELAY(ms,d) usleep(1000*ms); d=ms
#endif
/* define this to check for external asynchronous ineterrupts*/
#define MMIX_GET_INTERRUPT
......@@ -57,6 +63,14 @@ extern int mmix_fputc(int c, FILE *f);
#define fputc(c,f) mmix_fputc(c,f)
#endif
#define MMIX_USAGE if (!*cur_arg) scan_option("?",true) /* exit with usage note */
#define MMIX_BREAK_LOOP false
#define MMIX_BOOT false
#define MMIX_END halted
/* define this if you need the tetra inside the mem_node */
#define MEM_NODE_TET tetra tet; /* the tetrabyte of simulated memory */
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment