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_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
LDFLAGS = @LDFLAGS@ LDFLAGS = -g @LDFLAGS@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
RM = rm -f RM = rm -f
@ -44,7 +44,7 @@ mandir = $(prefix)/man/man$(manext)
$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir)/c -I$(srcdir)/cig $(CFLAGS) -o $@ $< $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir)/c -I$(srcdir)/cig $(CFLAGS) -o $@ $<
# You might want to change RUNNABLE to "s48" # You might want to change RUNNABLE to "s48"
RUNNABLE = s4853 RUNNABLE = scsh06
MANPAGE = $(RUNNABLE).$(manext) MANPAGE = $(RUNNABLE).$(manext)
LIB = $(libdir)/$(RUNNABLE) LIB = $(libdir)/$(RUNNABLE)
@ -107,13 +107,12 @@ CIGOBJS = cig/libcig.o cig/libcig1.o
#JMG: the scsh-lib #JMG: the scsh-lib
LIBSCSH = scsh/lib$(VM).a LIBSCSH = scsh/lib$(VM).a
SCSHVMHACKS = proc2.o SCSHVMHACKS = scsh/proc2.o
#JMG: and it's object files #JMG: and it's object files
#JMG left out: scsh/re.o scsh/re1.o scsh/regexp/regexp.o scsh/regexp/regsub.o #JMG left out: scsh/re.o scsh/re1.o scsh/regexp/regexp.o scsh/regexp/regsub.o
# scsh/fdports1.o # scsh/fdports1.o
# scsh/rdelim.o # scsh/rdelim.o
SCSHOBJS = \ SCSHOBJS = \
scsh/dirstuff1.o \ scsh/dirstuff1.o \
scsh/flock.o scsh/flock1.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 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 #JMG: I omit process_args.o and SCSHVMHACKS no longer
OBJS = c/scheme48vm.o c/scheme48heap.o c/extension.o c/external.o \ S48OBJS = c/scheme48vm.o c/scheme48heap.o c/extension.o c/external.o
$(CIGOBJS) $(SCSHOBJS) OBJS = scsh/process_args.o $(S48OBJS) $(CIGOBJS) $(SCSHOBJS) $(SCSHVMHACKS)
FAKEHS = c/fake/dlfcn.h c/fake/sigact.h c/fake/strerror.h \ FAKEHS = c/fake/dlfcn.h c/fake/sigact.h c/fake/strerror.h \
c/fake/sys-select.h c/fake/sys-select.h
@ -157,9 +156,16 @@ enough: $(VM) $(IMAGE) go $(LIBCIG) scsh $(LIBSCSH)
# External code to include in the VM # External code to include in the VM
# After changing any of these you should delete `scheme48vm' and remake it. # 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_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. # 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. # This says how to process .scm files with cig to make .c stubs.
.SUFFIXES: .scm .SUFFIXES: .scm
.scm.c: .scm.c:
$(srcdir)/cig/cigscript $* # $(srcdir)/cig/cigscript $*
# $(srcdir)/$(VM) -o $(srcdir)/$(VM) -i $(CIG) < $< > $*.c $(srcdir)/$(VM) -o $(srcdir)/$(VM) -i $(CIG) < $< > $*.c
# These .h files mediate between the code exported from foo1.c # These .h files mediate between the code exported from foo1.c
# and imported into foo.scm's stub foo.c. # and imported into foo.scm's stub foo.c.
@ -204,6 +210,7 @@ JMG: scsh stuff
scsh/dirstuff1.o: scsh/dirstuff1.h scsh/dirstuff1.o: scsh/dirstuff1.h
scsh/rdelim.o: scsh/fdports1.h scsh/rdelim.o: scsh/fdports1.h
scsh/userinfo1.o: scsh/userinfo1.h scsh/userinfo1.o: scsh/userinfo1.h
scsh/fdports1.o scsh/fdports.o: scsh/fdports1.h scsh/fdports1.o scsh/fdports.o: scsh/fdports1.h
scsh/flock1.o scsh/flock.o: scsh/flock1.h scsh/flock1.o scsh/flock.o: scsh/flock1.h
scsh/network1.o scsh/network.o: scsh/network1.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/time1.o scsh/time.o: scsh/time1.h
scsh/tty1.o scsh/tty.o: scsh/tty1.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/syscalls.o: scsh/syscalls1.h scsh/dirstuff1.h scsh/fdports1.h \
scsh/select1.h scsh/userinfo1.h scsh/select1.h scsh/userinfo1.h
scsh/sighandlers1.o scsh/sighandlers.o: scsh/sighandlers1.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 include $(srcdir)/scsh/machine/Makefile.inc
# Berkeley make wants to see this instead: (or use GNU make on BSD. -bri) # Berkeley make wants to see this instead: (or use GNU make on BSD. -bri)
#.include "$(srcdir)/scsh/machine/Makefile.inc" #.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) && \ $(EXTERNAL_OBJECTS) $(EXTERNAL_LD_FLAGS) && \
rm -f /tmp/s48_external_$$$$.c 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 #JMG: again cig and scsh-lib
$(LIBCIG): c/main.o $(OBJS) $(LIBCIG): c/main.o $(OBJS)
# $(CC) -r -o $@ main.o $(OBJS) # $(CC) -r -o $@ main.o $(OBJS)
$(RM) $@ $(RM) $@
$(AR) $@ c/main.o $(OBJS) $(AR) $@ c/main.o $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
$(LIBSCSH): c/smain.o $(OBJS) $(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 \ $(IMAGE): $(VM) scheme/env/init-defpackage.scm scheme/more-interfaces.scm \
scheme/link-packages.scm scheme/more-packages.scm \ scheme/link-packages.scm scheme/more-packages.scm \
$(usual-files) build/initial.debug build/build-usual-image $(usual-files) build/initial.debug build/build-usual-image
build/build-usual-image . "`pwd`/scheme" '$(IMAGE)' './$(VM)' \ sh $(srcdir)/build/build-usual-image "$(srcdir)" "$(LIB)" "$(IMAGE)" \
'$(INITIAL)' "$(VM)" "$(INITIAL)"
# build/build-usual-image . "`pwd`/scheme" '$(IMAGE)' './$(VM)' \
# '$(INITIAL)'
### Fake targets: all clean install man dist ### Fake targets: all clean install man dist
@ -367,7 +393,7 @@ clean-cig:
-rm -f cig/*.o $(CIG) $(CIG).image $(LIBCIG) -rm -f cig/*.o $(CIG) $(CIG).image $(LIBCIG)
clean-scm2c: 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 scsh/re.c scsh/select.c scsh/syscalls.c scsh/tty.c scsh/time.c
#JMG: moved config.cache to distclean #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 # The following have not been updated for the new directory organization
c/smain.o: c/main.c 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 mini: mini-heap.o c/smain.o
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ c/smain.o mini-heap.o $(OBJS) $(LIBS) $(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 mv ../scheme/vm/scheme48vm.c ../scheme/vm/scheme48heap.c ../c
cig: $(CIG) $(CIG).image $(LIBCIG) 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 ",batch"; \
echo ",translate =scheme48/ $(srcdir)/scheme/"; \ echo ",translate =scheme48/ $(srcdir)/scheme/"; \
echo ",config ,load $(srcdir)/cig/cig.scm"; \ 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) | ./$(VM) -i ./$(IMAGE)
$(srcdir)/cig/image2script $(LIB)/$(VM) </tmp/cig > $(CIG) $(srcdir)/cig/image2script $(LIB)/$(VM) </tmp/cig > $(CIG)
-chmod +x $(CIG) -chmod +x $(CIG)
mv /tmp/cig $(srcdir)/cig/standalone.image # mv /tmp/cig $(srcdir)/cig/standalone.image
$(RM) /tmp/cig $(RM) /tmp/cig
$(CIG)2: $(CIG)2:
@ -746,10 +773,10 @@ SCHEME =scsh/awk.scm \
############################################################ ############################################################
cig/libcig.c: cig/libcig.scm cig/libcig.c: cig/libcig.scm
scsh/flock.c: scsh/flock.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/network.c: scsh/network.scm
scsh/rdelim.c: scsh/rdelim.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/select.c: scsh/select.scm
scsh/syscalls.c: scsh/syscalls.scm scsh/syscalls.c: scsh/syscalls.scm
scsh/tty.c: scsh/tty.scm scsh/tty.c: scsh/tty.scm
@ -761,6 +788,15 @@ scsh/scsh: scsh/scsh-tramp.c
-DIMAGE=\"$(LIB)/scsh.image\" \ -DIMAGE=\"$(LIB)/scsh.image\" \
scsh/scsh-tramp.c 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 #JMG : not anymore appropriate
#echo ",open external-calls"; \ #echo ",open external-calls"; \
# echo "(lookup-all-externals)"; \ # echo "(lookup-all-externals)"; \
@ -783,6 +819,7 @@ scsh/scsh.image: $(VM) $(SCHEME) $(CIG).image
echo ",user"; \ echo ",user"; \
echo ",open floatnums"; \ echo ",open floatnums"; \
echo ",open scsh"; \ echo ",open scsh"; \
echo ",dump scsh06.image"; \
echo "(dump-scsh \"scsh/scsh.image\")") \ echo "(dump-scsh \"scsh/scsh.image\")") \
| ./$(VM) -o ./$(VM) -i $(CIG).image -h 5000000 | ./$(VM) -o ./$(VM) -i $(CIG).image -h 5000000
@ -819,8 +856,8 @@ scsh/scsh.image: $(VM) $(SCHEME) $(CIG).image
# < scsh/scsh.image > $@ # < scsh/scsh.image > $@
# -chmod +x $@ # -chmod +x $@
scsh/regexp/libregexp.a: scsh/regexp/libregex.a:
cd ./scsh/regexp; $(MAKE) cd ./scsh/regexp; $(MAKE) lib
scsh/scsh.vm: $(LIBSCSH) $(VM) scsh/scsh.image scsh/scsh.vm: $(LIBSCSH) $(VM) scsh/scsh.image
./$(VM) -o ./$(VM) -h 8000000 -i 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) scsh/*.o scsh/regexp/*.o scsh/machine/*.o scsh/*.image scsh/scsh
$(RM) $(LIBSCSH) scsh/scsh.vm $(RM) $(LIBSCSH) scsh/scsh.vm
# -cd scsh/regexp; $(MAKE) clean JMG: no extra regep # -cd scsh/regexp; $(MAKE) clean JMG: no extra regep