some hacks

This commit is contained in:
marting 1999-09-20 16:46:48 +00:00
parent eaf83d0524
commit 3b635bbeec
1 changed files with 61 additions and 23 deletions

View File

@ -14,7 +14,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
LDFLAGS = @LDFLAGS@
LDFLAGS = -g @LDFLAGS@
LIBOBJS = @LIBOBJS@
RM = rm -f
@ -44,7 +44,7 @@ mandir = $(prefix)/man/man$(manext)
$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir)/c -I$(srcdir)/cig $(CFLAGS) -o $@ $<
# You might want to change RUNNABLE to "s48"
RUNNABLE = s4853
RUNNABLE = scsh06
MANPAGE = $(RUNNABLE).$(manext)
LIB = $(libdir)/$(RUNNABLE)
@ -107,13 +107,12 @@ CIGOBJS = cig/libcig.o cig/libcig1.o
#JMG: the scsh-lib
LIBSCSH = scsh/lib$(VM).a
SCSHVMHACKS = proc2.o
SCSHVMHACKS = scsh/proc2.o
#JMG: and it's object files
#JMG left out: scsh/re.o scsh/re1.o scsh/regexp/regexp.o scsh/regexp/regsub.o
# scsh/fdports1.o
# scsh/rdelim.o
# scsh/rdelim.o
SCSHOBJS = \
scsh/dirstuff1.o \
scsh/flock.o scsh/flock1.o \
@ -133,9 +132,9 @@ SCSHOBJS = \
UNIX_OBJS = c/unix/misc.o c/unix/io.o c/unix/fd-io.o c/unix/event.o
#JMG: I omit process_args.o and SCSHVMHACKS at the moment
OBJS = c/scheme48vm.o c/scheme48heap.o c/extension.o c/external.o \
$(CIGOBJS) $(SCSHOBJS)
#JMG: I omit process_args.o and SCSHVMHACKS no longer
S48OBJS = c/scheme48vm.o c/scheme48heap.o c/extension.o c/external.o
OBJS = scsh/process_args.o $(S48OBJS) $(CIGOBJS) $(SCSHOBJS) $(SCSHVMHACKS)
FAKEHS = c/fake/dlfcn.h c/fake/sigact.h c/fake/strerror.h \
c/fake/sys-select.h
@ -157,9 +156,16 @@ enough: $(VM) $(IMAGE) go $(LIBCIG) scsh $(LIBSCSH)
# External code to include in the VM
# After changing any of these you should delete `scheme48vm' and remake it.
EXTERNAL_OBJECTS = $(SOCKET_OBJECTS) $(LOOKUP_OBJECTS)
CIGGED = flock network select syscalls tty time sighandlers
#re rdelim
CIGGEDOBJ = $(patsubst %,scsh/%.o, $(CIGGED))
CIGGEDINIT = $(patsubst %,s48_init_%, $(CIGGED))
EXTERNAL_OBJECTS = $(SOCKET_OBJECTS) $(LOOKUP_OBJECTS)
EXTERNAL_FLAGS = $(SOCKET_FLAGS)
EXTERNAL_INITIALIZERS = $(SOCKET_INITIALIZERS) $(LOOKUP_INITIALIZERS) ciginit
EXTERNAL_INITIALIZERS = $(SOCKET_INITIALIZERS) $(LOOKUP_INITIALIZERS) s48_init_cig \
$(CIGGEDINIT)
# Rules for any external code.
@ -195,8 +201,8 @@ JMG: scsh stuff
# This says how to process .scm files with cig to make .c stubs.
.SUFFIXES: .scm
.scm.c:
$(srcdir)/cig/cigscript $*
# $(srcdir)/$(VM) -o $(srcdir)/$(VM) -i $(CIG) < $< > $*.c
# $(srcdir)/cig/cigscript $*
$(srcdir)/$(VM) -o $(srcdir)/$(VM) -i $(CIG) < $< > $*.c
# These .h files mediate between the code exported from foo1.c
# and imported into foo.scm's stub foo.c.
@ -204,6 +210,7 @@ JMG: scsh stuff
scsh/dirstuff1.o: scsh/dirstuff1.h
scsh/rdelim.o: scsh/fdports1.h
scsh/userinfo1.o: scsh/userinfo1.h
scsh/fdports1.o scsh/fdports.o: scsh/fdports1.h
scsh/flock1.o scsh/flock.o: scsh/flock1.h
scsh/network1.o scsh/network.o: scsh/network1.h
@ -213,11 +220,15 @@ scsh/syscalls1.o scsh/syscalls.o: scsh/syscalls1.h
scsh/time1.o scsh/time.o: scsh/time1.h
scsh/tty1.o scsh/tty.o: scsh/tty1.h
scsh/rx/re1.o scsh/rx/re-low.o: scsh/rx/re1.h
scsh/syscalls.o: scsh/syscalls1.h scsh/dirstuff1.h scsh/fdports1.h \
scsh/select1.h scsh/userinfo1.h
scsh/sighandlers1.o scsh/sighandlers.o: scsh/sighandlers1.h
scsh/rx/re-low.o: scsh/regexp/libregex.a
include $(srcdir)/scsh/machine/Makefile.inc
# Berkeley make wants to see this instead: (or use GNU make on BSD. -bri)
#.include "$(srcdir)/scsh/machine/Makefile.inc"
@ -232,11 +243,24 @@ $(VM): c/main.o $(OBJS) $(UNIX_OBJS) $(LIBOBJS) $(EXTERNAL_OBJECTS)
$(EXTERNAL_OBJECTS) $(EXTERNAL_LD_FLAGS) && \
rm -f /tmp/s48_external_$$$$.c
$(CIGVM): c/main.o $(S48OBJS) $(CIGOBJS) $(UNIX_OBJS) $(LIBOBJS) \
$(LOOKUP_OBJECTS)
rm -f /tmp/s48_external_$$$$.c && \
build/build-external-modules /tmp/s48_external_$$$$.c \
$(LOOKUP_INITIALIZERS) s48_init_cig && \
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/main.o $(LOOKUP_OBJECTS) \
$(S48OBJS) $(CIGOBJS) $(UNIX_OBJS) \
/tmp/s48_external_$$$$.c \
$(LIBOBJS) $(LIBS) \
$(EXTERNAL_LD_FLAGS) && \
rm -f /tmp/s48_external_$$$$.c
#JMG: again cig and scsh-lib
$(LIBCIG): c/main.o $(OBJS)
# $(CC) -r -o $@ main.o $(OBJS)
$(RM) $@
$(AR) $@ c/main.o $(OBJS)
$(AR) $@ c/main.o $(OBJS)
$(RANLIB) $@
$(LIBSCSH): c/smain.o $(OBJS)
@ -274,8 +298,10 @@ c/fake/strerror.o: c/fake/strerror.h
$(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \
scheme/link-packages.scm scheme/more-packages.scm \
$(usual-files) build/initial.debug build/build-usual-image
build/build-usual-image . "`pwd`/scheme" '$(IMAGE)' './$(VM)' \
'$(INITIAL)'
sh $(srcdir)/build/build-usual-image "$(srcdir)" "$(LIB)" "$(IMAGE)" \
"$(VM)" "$(INITIAL)"
# build/build-usual-image . "`pwd`/scheme" '$(IMAGE)' './$(VM)' \
# '$(INITIAL)'
### Fake targets: all clean install man dist
@ -367,7 +393,7 @@ clean-cig:
-rm -f cig/*.o $(CIG) $(CIG).image $(LIBCIG)
clean-scm2c:
rm -f scsh/flock.c scsh/jcontrol2.c scsh/network.c scsh/rdelim.c \
rm -f scsh/flock.c scsh/network.c scsh/rdelim.c \
scsh/re.c scsh/select.c scsh/syscalls.c scsh/tty.c scsh/time.c
#JMG: moved config.cache to distclean
@ -568,7 +594,7 @@ scheme/debug/medium.image: $(LINKER_IMAGE) $(CONFIG_FILES)
# The following have not been updated for the new directory organization
c/smain.o: c/main.c
$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DSTATIC_AREAS -o $@ c/main.c
$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DSTATIC_AREAS -o $@ $(srcdir)/c/main.c
mini: mini-heap.o c/smain.o
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/smain.o mini-heap.o $(OBJS) $(LIBS)
@ -638,7 +664,8 @@ i-know-what-i-am-doing:
mv ../scheme/vm/scheme48vm.c ../scheme/vm/scheme48heap.c ../c
cig: $(CIG) $(CIG).image $(LIBCIG)
$(CIG): $(VM) $(IMAGE) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm
$(CIG): $(VM) $(IMAGE) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm
(echo ",batch"; \
echo ",translate =scheme48/ $(srcdir)/scheme/"; \
echo ",config ,load $(srcdir)/cig/cig.scm"; \
@ -650,7 +677,7 @@ $(CIG): $(VM) $(IMAGE) $(srcdir)/cig/cig.scm $(srcdir)/cig/libcig.scm
| ./$(VM) -i ./$(IMAGE)
$(srcdir)/cig/image2script $(LIB)/$(VM) </tmp/cig > $(CIG)
-chmod +x $(CIG)
mv /tmp/cig $(srcdir)/cig/standalone.image
# mv /tmp/cig $(srcdir)/cig/standalone.image
$(RM) /tmp/cig
$(CIG)2:
@ -746,10 +773,10 @@ SCHEME =scsh/awk.scm \
############################################################
cig/libcig.c: cig/libcig.scm
scsh/flock.c: scsh/flock.scm
scsh/jcontrol2.c: scsh/jcontrol2.scm
#scsh/jcontrol2.c: scsh/jcontrol2.scm
scsh/network.c: scsh/network.scm
scsh/rdelim.c: scsh/rdelim.scm
scsh/re.c: scsh/re.scm
#scsh/re.c: scsh/re.scm
scsh/select.c: scsh/select.scm
scsh/syscalls.c: scsh/syscalls.scm
scsh/tty.c: scsh/tty.scm
@ -761,6 +788,15 @@ scsh/scsh: scsh/scsh-tramp.c
-DIMAGE=\"$(LIB)/scsh.image\" \
scsh/scsh-tramp.c
loads = $(srcdir)/scsh/let-opt.scm $(srcdir)/scsh/scsh-interfaces.scm \
$(srcdir)/scsh/machine/packages.scm \
$(srcdir)/scsh/rx/packages.scm \
$(srcdir)/scsh/rx/cond-package.scm \
$(srcdir)/scsh/scsh-package.scm \
$(srcdir)/scsh/lib/string-pack.scm \
$(srcdir)/scsh/lib/list-pack.scm \
$(srcdir)/scsh/lib/ccp-pack.scm
#JMG : not anymore appropriate
#echo ",open external-calls"; \
# echo "(lookup-all-externals)"; \
@ -783,6 +819,7 @@ scsh/scsh.image: $(VM) $(SCHEME) $(CIG).image
echo ",user"; \
echo ",open floatnums"; \
echo ",open scsh"; \
echo ",dump scsh06.image"; \
echo "(dump-scsh \"scsh/scsh.image\")") \
| ./$(VM) -o ./$(VM) -i $(CIG).image -h 5000000
@ -819,8 +856,8 @@ scsh/scsh.image: $(VM) $(SCHEME) $(CIG).image
# < scsh/scsh.image > $@
# -chmod +x $@
scsh/regexp/libregexp.a:
cd ./scsh/regexp; $(MAKE)
scsh/regexp/libregex.a:
cd ./scsh/regexp; $(MAKE) lib
scsh/scsh.vm: $(LIBSCSH) $(VM) scsh/scsh.image
./$(VM) -o ./$(VM) -h 8000000 -i scsh/scsh.image \
@ -845,3 +882,4 @@ clean-scsh:
$(RM) scsh/*.o scsh/regexp/*.o scsh/machine/*.o scsh/*.image scsh/scsh
$(RM) $(LIBSCSH) scsh/scsh.vm
# -cd scsh/regexp; $(MAKE) clean JMG: no extra regep