# HG changeset patch # User Michael FIG <[EMAIL PROTECTED]> # Date 1205294804 21600 # Node ID b7517504cb7a4214bae5023bdbed29de9b5c9aff # Parent 8a3813f99822fcde13411357637dda3d9dc8ff01 Update Makefiles to be more friendly.
diff -r 8a3813f99822 -r b7517504cb7a Makefile --- a/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,33 +1,36 @@ SUBDIRS = object function SUBDIRS = object function all : .FORCE - $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) ); done' + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) ); done' + +run : .FORCE + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) run ); done' dist : .FORCE - $(SHELL) -ec '( cd dist; $(MAKE) dist )' + $(SHELL) -ec '( cd dist && $(MAKE) dist )' install : .FORCE - $(SHELL) -ec '( cd object; $(MAKE) install )' + $(SHELL) -ec '( cd object && $(MAKE) install )' dist-src : .FORCE - $(SHELL) -ec '( cd dist; $(MAKE) dist-src )' + $(SHELL) -ec '( cd dist && $(MAKE) dist-src )' config : .FORCE - $(SHELL) -ec '( cd object; $(MAKE) config )' + $(SHELL) -ec '( cd object && $(MAKE) config )' win32 : .FORCE $(MAKE) TARGET="i686-pc-mingw32" tidy : .FORCE rm -f *~ - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) tidy ); done' + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) tidy ); done' clean : .FORCE rm -f *~ - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) clean ); done' + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) clean ); done' distclean spotless : .FORCE -rm -f *~ - -$(SHELL) -c 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) distclean ); done' + -$(SHELL) -c 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) distclean ); done' .FORCE : diff -r 8a3813f99822 -r b7517504cb7a function/Makefile --- a/function/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,18 +1,21 @@ SUBDIRS = objects jolt-burg SUBDIRS = objects jolt-burg all : .FORCE - $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) ); done' + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) ); done' tidy : .FORCE rm -f *~ - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) tidy ); done' + -$(SHELL) -ec 'for dir in $(SUBDIRS) examples; do ( cd $$dir && $(MAKE) tidy ); done' clean : .FORCE rm -f *~ - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) clean ); done' + -$(SHELL) -ec 'for dir in $(SUBDIRS) examples; do ( cd $$dir && $(MAKE) clean ); done' + +run test : .FORCE + $(SHELL) -ec 'for dir in $(SUBDIRS) examples; do ( cd $$dir && $(MAKE) run ); done' distclean spotless : .FORCE rm -f *~ - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) spotless ); done' + -$(SHELL) -ec 'for dir in $(SUBDIRS) examples; do ( cd $$dir && $(MAKE) spotless ); done' .FORCE : diff -r 8a3813f99822 -r b7517504cb7a function/examples/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/function/examples/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -0,0 +1,21 @@ +SUBDIRS = cairo jcanvas libjolt peg prag-parse profile regexp select slotnames struct tcp x-drawing x-event + +all : .FORCE + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) ); done' + +tidy : .FORCE + rm -f *~ + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) tidy ); done' + +clean : .FORCE + rm -f *~ + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) clean ); done' + +run test : .FORCE + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) run ); done' + +distclean spotless : .FORCE + rm -f *~ + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) spotless ); done' + +.FORCE : diff -r 8a3813f99822 -r b7517504cb7a function/examples/cairo/Makefile --- a/function/examples/cairo/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/cairo/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,11 +1,12 @@ JOLT = ../../jolt-burg/main JOLT = ../../jolt-burg/main +IDC = ../idc CAIROINC = $(patsubst %,-J%,$(wildcard /usr/include/cairo) $(wildcard /usr/local/include/cairo)) -test : cairolib.so .FORCE +run test : cairolib.so .FORCE $(JOLT) boot.k main.k cairolib.so : cairolib.st - idc $(CAIROINC) -I../../objects -s $< + $(IDC) $(CAIROINC) -I../../objects -s $< clean : .FORCE rm -f *~ *.so *.o diff -r 8a3813f99822 -r b7517504cb7a function/examples/jcanvas/Makefile --- a/function/examples/jcanvas/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/jcanvas/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,7 +1,7 @@ JOLT = ../../jolt-burg/main JOLT = ../../jolt-burg/main CAIROINC = $(patsubst %,-J%,$(wildcard /usr/include/cairo) $(wildcard /usr/local/include/cairo)) -test : _cairo.so cairo.so .FORCE +run test : _cairo.so cairo.so .FORCE $(JOLT) boot.k main.k IDC = ../idc -O diff -r 8a3813f99822 -r b7517504cb7a function/examples/libjolt/Makefile --- a/function/examples/libjolt/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/libjolt/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -18,10 +18,11 @@ JOLT_BOOT_FILES = boot.k quasiquote.k sy JOLT_BOOT_FILES = boot.k quasiquote.k syntax.k number.k object.k JOLT_BOOT_FILES := $(addprefix $(JOLT)/, $(JOLT_BOOT_FILES)) -all : jest$(OBJEXT) +all : jest$(OBJEXT) test-libjolt$(OBJEXT) -test : jest$(OBJEXT) .FORCE - ./jest$(OBJEXT) +run test : all .FORCE + $(IDC) -exec ./jest + $(IDC) -exec ./test-libjolt .SUFFIXES : diff -r 8a3813f99822 -r b7517504cb7a function/examples/peg/Makefile --- a/function/examples/peg/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/peg/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,4 +1,5 @@ JOLT = ../../jolt-burg/main JOLT = ../../jolt-burg/main +IDC = ../idc all : peg.k @@ -7,7 +8,7 @@ peg.k : $(JOLT) boot.k peg.peg.k -o peg.k peg.peg diff peg.peg.k peg.k -test : basic.peg.k +run test : basic.peg.k $(JOLT) boot.k basic.peg.k examples/test.bas # $(JOLT) boot.k basic.peg.k examples/fibonacci.bas $(JOLT) boot.k basic.peg.k examples/bench.bas diff -r 8a3813f99822 -r b7517504cb7a function/examples/select/Makefile --- a/function/examples/select/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/select/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,6 +1,7 @@ JOLT = ../../jolt-burg/main JOLT = ../../jolt-burg/main +IDC = ../idc -test : .FORCE +run test : .FORCE $(JOLT) boot.k main.k clean : .FORCE diff -r 8a3813f99822 -r b7517504cb7a function/examples/struct/Makefile --- a/function/examples/struct/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/struct/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -3,6 +3,8 @@ LIB = X11-Xlib.h LIB = X11-Xlib.h all : $(LIB).k + +run test : all $(LIB).k : $(LIB).k-gen.c cc -o [EMAIL PROTECTED] $< diff -r 8a3813f99822 -r b7517504cb7a function/examples/tcp/Makefile --- a/function/examples/tcp/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/tcp/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,6 +5,8 @@ LIBS = Match.o Match-printing.o ParseStr LIBS = Match.o Match-printing.o ParseStream.o NetworkPseudoInterface.o all : $(LIBS) $(PROGRAM) + +run : test test : $(LIBS) $(PROGRAM) .FORCE time ./$(PROGRAM) < test.k diff -r 8a3813f99822 -r b7517504cb7a function/examples/x-drawing/Makefile --- a/function/examples/x-drawing/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/x-drawing/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,6 +1,7 @@ JOLT = ../../jolt-burg/main JOLT = ../../jolt-burg/main +IDC = ../idc -test : .FORCE +run test : .FORCE $(JOLT) boot.k canvas.k clean : .FORCE diff -r 8a3813f99822 -r b7517504cb7a function/examples/x-event/Makefile --- a/function/examples/x-event/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/examples/x-event/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,6 +1,7 @@ JOLT = ../../jolt-burg/main JOLT = ../../jolt-burg/main +IDC = ../idc -test : .FORCE +run test : .FORCE $(JOLT) boot.k x-event.k clean : .FORCE diff -r 8a3813f99822 -r b7517504cb7a function/jolt-burg/Makefile --- a/function/jolt-burg/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/jolt-burg/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -27,7 +27,9 @@ all : main$(OBJEXT) all : main$(OBJEXT) test : main$(OBJEXT) .FORCE - ./main$(OBJEXT) boot.k sanaras.k + $(IDC) -exec ./main$(OBJEXT) boot.k sanaras.k + +run : test .FORCE .SUFFIXES : diff -r 8a3813f99822 -r b7517504cb7a function/objects/Makefile --- a/function/objects/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/objects/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -19,6 +19,9 @@ all : objects.a test : objects.a test.st $(IDC) $(IDFLAGS) test.st objects.a -lreadline + +run : test + $(IDC) -exec ./test .SUFFIXES : diff -r 8a3813f99822 -r b7517504cb7a function/objects/idc --- a/function/objects/idc Tue Mar 11 22:05:55 2008 -0600 +++ b/function/objects/idc Tue Mar 11 22:06:44 2008 -0600 @@ -1,7 +1,8 @@ #!/bin/sh - -if test -x ../../object/stage2/idc; then - ../../object/stage2/idc -B ../../object/stage2/ $* +thisdir=`echo "$0" | sed -e 's%/[^/]*$%%'` +test "X$thisdir" = "X$0" && thisdir=. +if test -x "$thisdir/../../object/stage2/idc"; then + "$thisdir/../../object/stage2/idc" -B "$thisdir/../../object/stage2/" $* else idc $* fi diff -r 8a3813f99822 -r b7517504cb7a function/objects/mpint/Makefile --- a/function/objects/mpint/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/function/objects/mpint/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,6 +1,6 @@ SRCS := $(wildcard *.c) SRCS := $(wildcard *.c) OBJS := $(SRCS:.c=.o) -IDC := idc +IDC := ../idc CFLAGS := -I. $(shell $(IDC) -C MFLAGS) $(shell $(IDC) -C O3FLAGS) mpint.a : $(wildcard *.[ch]) diff -r 8a3813f99822 -r b7517504cb7a object/Makefile --- a/object/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -11,31 +11,31 @@ boot : .config-stamp .FORCE stage1 : .FORCE -$(SHELL) -ec '[ -d stage1 ] || mkdir stage1' - $(SHELL) -ec 'for dir in $(SUBDIRS); do ( echo $$dir; cd $$dir; $(MAKE) IDC="../boot/idc -B../boot/ -O" BIN="../stage1/" ); done' + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( echo $$dir; cd $$dir && $(MAKE) IDC="../boot/idc -B../boot/ -O -Wc,-DSTAGE1=1" BIN="../stage1/" DEP="../boot/idc1 ../boot/include/id/id.h" PROGDEP="../boot/libid.o" ) || exit $$?; done' stage2 : .FORCE -$(SHELL) -ec '[ -d stage2 ] || mkdir stage2' - $(SHELL) -ec 'for dir in $(SUBDIRS); do ( echo $$dir; cd $$dir; $(MAKE) IDC="../stage1/idc -B../stage1/ -O" BIN="../stage2/" ); done' + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( echo $$dir; cd $$dir && $(MAKE) IDC="../stage1/idc -B../stage1/ -O" BIN="../stage2/" DEP="../stage1/idc1 ../stage1/include/id/id.h" PROGDEP="../stage1/libid.o" ) || exit $$?; done' stage3 : .FORCE -$(SHELL) -ec '[ -d stage3 ] || mkdir stage3' - $(SHELL) -ec 'for dir in $(SUBDIRS); do ( echo $$dir; cd $$dir; $(MAKE) IDC="../stage2/idc -B../stage2/ -g" BIN="../stage3/" ); done' + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( echo $$dir; cd $$dir && $(MAKE) IDC="../stage2/idc -B../stage2/ -g" BIN="../stage3/" DEP="../stage2/idc1 ../stage2/include/id/id.h" PROGDEP="../stage2/libid_g.o" ) || exit $$?; done' test2 : stage2 .FORCE - -$(SHELL) -ec '( cd examples/hw; make clean; ../../stage2/idc -B../../stage2/ -I../../st80 -g -k hw.st; LD_LIBRARY_PATH=../../stage2 ./hw )' + -$(SHELL) -ec '( IDC_STAGE=stage2; export IDC_STAGE; cd examples/hw && $(MAKE) clean && $(MAKE) run )' test3 : stage3 .FORCE - -$(SHELL) -ec '( cd examples/hw; make clean; ../../stage3/idc -B../../stage3/ -I../../st80 -g -k hw.st; LD_LIBRARY_PATH=../../stage3 ./hw )' + -$(SHELL) -ec '( IDC_STAGE=stage3; export IDC_STAGE; cd examples/hw && $(MAKE) clean && $(MAKE) run )' rebuild : .FORCE rm -rf stage*/include stage*/idc1 $(MAKE) install : all .FORCE - $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) IDC="../stage1/idc -B../stage1/ -O" BIN="../stage2/" install ); done' + $(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) IDC="../stage1/idc -B../stage1/ -O" BIN="../stage2/" install ) || exit $$?; done' install-boot : boot .FORCE - $(SHELL) -ec '( cd boot; $(MAKE) install )' + $(SHELL) -ec '( cd boot && $(MAKE) install )' win32 : .FORCE $(MAKE) TARGET="i686-pc-mingw32" @@ -46,10 +46,10 @@ newboot : all .FORCE cp -p id/*.h boot/include/id/. dist : .config-stamp .FORCE - $(SHELL) -ec '( cd dist; $(MAKE) dist )' + $(SHELL) -ec '( cd dist && $(MAKE) dist )' dist-src : .config-stamp .FORCE - $(SHELL) -ec '( cd dist; $(MAKE) dist-src )' + $(SHELL) -ec '( cd dist && $(MAKE) dist-src )' .config-stamp : boot/configure */*.in ./boot/configure $(TARGET) $(PREFIX) $(CONFIG) && touch .config-stamp @@ -59,9 +59,9 @@ config : .FORCE ./boot/configure $(TARGET) $(PREFIX) $(CONFIG) && touch .config-stamp cp -p idc/idc boot/. -test : all .FORCE - $(SHELL) -ec '( cd test; $(MAKE) run )' - $(SHELL) -ec '( cd st80; $(MAKE) run )' +run test : all .FORCE + $(SHELL) -ec '( cd examples && $(MAKE) run )' +#$(SHELL) -ec '( cd st80 && $(MAKE) run )' tidy : .config-stamp .FORCE rm -f *~ @@ -76,7 +76,7 @@ clean3 : .FORCE distclean spotless : .config-stamp .FORCE -rm -f *~ .config-stamp - -$(SHELL) -c 'for dir in boot $(SUBDIRS) examples; do ( cd $$dir; $(MAKE) clean distclean ); done' + -$(SHELL) -c 'for dir in boot $(SUBDIRS) examples; do ( cd $$dir && $(MAKE) clean distclean ); done' -$(SHELL) -c 'for dir in stage1 stage2 stage3; do rm -rf $$dir; done' .FORCE : diff -r 8a3813f99822 -r b7517504cb7a object/examples/00_README --- a/object/examples/00_README Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/00_README Tue Mar 11 22:06:44 2008 -0600 @@ -1,20 +1,5 @@ NOTE: These examples will only work if t -NOTE: These examples will only work if the 'idc' compiler has been -installed. To compile them without installing you will have to: - - - point the Makefiles at the uninstalled 'idc' by setting the - variable IDC on the command line; - - - tell 'idc' where to find its own compiled runtime libraries with - -the B option; and - - - tell 'idc' where to find the compile-time st80 libraries with the - -I option - -like this: - - cd hw - make IDC="../../../boot/idc -B../../../boot/ -I../../st80" - LD_LIBRARY_PATH=$PWD/../../../boot ./hw +NOTE: These examples will only work if you run them with 'make run' or +the stage2 'idc' compiler has been installed. NOTE: Compilation can be long on slow hardware because many of the examples import 'st80' causing the compiler to scan the source of the diff -r 8a3813f99822 -r b7517504cb7a object/examples/Makefile --- a/object/examples/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -1,21 +1,24 @@ SUBDIRS = avl dispatch echo forward hw i -SUBDIRS = avl dispatch echo forward hw ignore interp libs1 libs2 libs3 parse prototype reflect serialise slots sqvm system this traits typename weak x11 +SUBDIRS = avl dispatch echo forward hw ignore interp libs1 libs2 libs3 parse \ + prototype reflect serialise slots sqvm system this traits typename weak x11 all : .FORCE - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) ); done' + test ! -f ../stage2/clean-examples || $(MAKE) clean + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) ); done' run : .FORCE - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) run ); done' + test ! -f ../stage2/clean-examples || $(MAKE) clean + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) run ); done' tidy : .FORCE - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) tidy ); done' - rm -f *~ + rm -f *~ ../boot/clean-examples ../stage*/clean-examples + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) tidy ); done' clean : .FORCE - rm -f *~ - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) clean ); done' + rm -f *~ ../boot/clean-examples ../stage*/clean-examples + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) clean ); done' distclean spotless : .FORCE - rm -f *~ - -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir; $(MAKE) spotless ); done' + rm -f *~ ../boot/clean-examples ../stage*/clean-examples + -$(SHELL) -ec 'for dir in $(SUBDIRS); do ( cd $$dir && $(MAKE) spotless ); done' .FORCE : diff -r 8a3813f99822 -r b7517504cb7a object/examples/avl/Makefile --- a/object/examples/avl/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/avl/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) %.so : %.st $(IDC) -s $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/dispatch/Makefile --- a/object/examples/dispatch/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/dispatch/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/echo/Makefile --- a/object/examples/echo/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/echo/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) hello world + $(IDC) -exec ./$(PROGRAM) hello world % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/forward/Makefile --- a/object/examples/forward/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/forward/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/hw/Makefile --- a/object/examples/hw/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/hw/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/idc --- a/object/examples/idc Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/idc Tue Mar 11 22:06:44 2008 -0600 @@ -1,7 +1,9 @@ #!/bin/sh -if test -x ../../stage2/idc; then - exec ../../stage2/idc -B ../../stage2/ -I../../st80 $* +IDC_STAGE=${IDC_STAGE-stage2} + +if test -x ../../$IDC_STAGE/idc; then + exec ../../$IDC_STAGE/idc -B ../../stage2/ -I../../st80 $* else exec idc $* fi diff -r 8a3813f99822 -r b7517504cb7a object/examples/ignore/Makefile --- a/object/examples/ignore/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/ignore/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - -./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) || : % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/interp/Makefile --- a/object/examples/interp/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/interp/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/libs1/Makefile --- a/object/examples/libs1/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/libs1/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) main : main.st libs.a $(IDC) main.st libs.a diff -r 8a3813f99822 -r b7517504cb7a object/examples/libs2/Makefile --- a/object/examples/libs2/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/libs2/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -6,7 +6,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./main + $(IDC) -exec ./main %.so : %.st $(IDC) -s $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/libs3/Makefile --- a/object/examples/libs3/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/libs3/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) main : main.st libs.so $(IDC) main.st diff -r 8a3813f99822 -r b7517504cb7a object/examples/parse/Makefile --- a/object/examples/parse/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/parse/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/prototype/Makefile --- a/object/examples/prototype/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/prototype/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/reflect/Makefile --- a/object/examples/reflect/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/reflect/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -22,7 +22,7 @@ all : $(SHOBJS) $(LDOBJS) $(PROGRAM) $(IDC) $< $(LDOBJS) $(LDLIBS) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) stats : .FORCE sort -u $(LDOBJS:$o=.st) | wc -l diff -r 8a3813f99822 -r b7517504cb7a object/examples/serialise/Makefile --- a/object/examples/serialise/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/serialise/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -22,7 +22,7 @@ all : $(SHOBJS) $(LDOBJS) $(PROGRAM) $(IDC) $< $(LDOBJS) $(LDLIBS) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) stats : .FORCE sort -u $(LDOBJS:$o=.st) | wc -l diff -r 8a3813f99822 -r b7517504cb7a object/examples/slotnames/Makefile --- a/object/examples/slotnames/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/slotnames/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -22,7 +22,7 @@ all : $(SHOBJS) $(LDOBJS) $(PROGRAM) $(IDC) $< $(LDOBJS) $(LDLIBS) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) stats : .FORCE sort -u $(LDOBJS:$o=.st) | wc -l diff -r 8a3813f99822 -r b7517504cb7a object/examples/slots/Makefile --- a/object/examples/slots/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/slots/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -22,7 +22,7 @@ all : $(SHOBJS) $(LDOBJS) $(PROGRAM) $(IDC) $< $(LDOBJS) $(LDLIBS) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) stats : .FORCE sort -u $(LDOBJS:$o=.st) | wc -l diff -r 8a3813f99822 -r b7517504cb7a object/examples/sqvm/Makefile --- a/object/examples/sqvm/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/sqvm/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -34,7 +34,7 @@ SqueakBitBlt.o : SqueakBitBlt.st BitBltP $(IDC) $< $(LDOBJS) $(LDLIBS) run : all - ./main mini.image + $(IDC) -exec ./main mini.image io-test : io-test.c $(CC) io-test.c -L/usr/X11R6/lib -lX11 -lm -o io-test diff -r 8a3813f99822 -r b7517504cb7a object/examples/system/Makefile --- a/object/examples/system/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/system/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,8 +5,8 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./system1 ls - ./system2 pwd + $(IDC) -exec ./system1 ls + $(IDC) -exec ./system2 pwd % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/this/Makefile --- a/object/examples/this/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/this/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/traits/Makefile --- a/object/examples/traits/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/traits/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,8 +5,8 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./simple - ./complex + $(IDC) -exec ./simple + $(IDC) -exec ./complex % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/typename/Makefile --- a/object/examples/typename/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/typename/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -5,7 +5,7 @@ all : $(PROGRAM) all : $(PROGRAM) run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) % : %.st $(IDC) $< diff -r 8a3813f99822 -r b7517504cb7a object/examples/weak/Makefile --- a/object/examples/weak/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/weak/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -8,7 +8,7 @@ all : $(PROGRAM) $(IDC) $< run : all - ./$(PROGRAM) + $(IDC) -exec ./$(PROGRAM) tidy: .FORCE rm -f *~ diff -r 8a3813f99822 -r b7517504cb7a object/examples/x11/Makefile --- a/object/examples/x11/Makefile Tue Mar 11 22:05:55 2008 -0600 +++ b/object/examples/x11/Makefile Tue Mar 11 22:06:44 2008 -0600 @@ -6,7 +6,7 @@ all : $(LIBS) $(PROGRAM) all : $(LIBS) $(PROGRAM) run : all - ./main + $(IDC) -exec ./main %.so : %.st $(IDC) -J/usr/X11R6/include -s $< -L/usr/X11R6/lib -lX11 diff -r 8a3813f99822 -r b7517504cb7a object/idc/Makefile.in --- a/object/idc/Makefile.in Tue Mar 11 22:05:55 2008 -0600 +++ b/object/idc/Makefile.in Tue Mar 11 22:06:44 2008 -0600 @@ -56,19 +56,20 @@ OBJEXT_SO = @OBJEXT_SO@ all : $(BIN)gc.a $(BIN)idst$(OBJEXT_SO) $(BIN)idc1$(OBJEXT) $(BIN)idc -$(BIN)idst$(OBJEXT_SO) : idst.st $(FILES) +$(BIN)idst$(OBJEXT_SO) : idst.st $(FILES) $(DEP) $(IDC) $(IINC) $(IDFLAGS) -s idst.st $(FILES) -o $@ .SUFFIXES : -$(BIN)%$(OBJEXT_SO) : %.st +$(BIN)%$(OBJEXT_SO) : %.st $(DEP) $(IDC) $(IINC) $(IDFLAGS) -s $< -o $@ -$(BIN)%$(OBJEXT_O) : %.st +$(BIN)%$(OBJEXT_O) : %.st $(DEP) $(IDC) $(IINC) $(IDFLAGS) -c $< -o $@ -$(BIN)%$(OBJEXT) : %.st +$(BIN)%$(OBJEXT) : %.st $(DEP) $(PROGDEP) $(IDC) $(IINC) $(IDFLAGS) $< -o $@ + echo timestamp > $(BIN)clean-examples $(BIN)idc : ../idc/idc -$(SHELL) -ec 'cp -p $< $@' diff -r 8a3813f99822 -r b7517504cb7a object/idc/idc.in --- a/object/idc/idc.in Tue Mar 11 22:05:55 2008 -0600 +++ b/object/idc/idc.in Tue Mar 11 22:06:44 2008 -0600 @@ -14,6 +14,7 @@ idtype="program" idtype="program" idmain="false" cckill="true" +exec="false" _p="" fatal () { @@ -59,6 +60,7 @@ usage: $program [-option ...] filename -C arch - print configured architecture -C os - print configured operating system -c - generate an object file + -exec - execute a compiled program when idc is not installed -g - generate debugging information -h - print help (this message) then exit -H - print copyright information then exit @@ -91,6 +93,7 @@ while [ $# -gt 0 ]; do -C?*) config="${1#-C}";; -C) checkarg $@; config="$2"; shift;; -c) idtype="object";; + -exec) exec=true; shift; break;; -f*) ccopts="$ccopts $1";; -g*) ccopts="$ccopts -g -DID_DEBUG=1"; idopts="$idopts -g"; _p="_g";; -I?*) idopts="$idopts -I${1#-I}";; @@ -200,36 +203,39 @@ case $idtype in ;; esac -if test -s .id.ldobjs; then +if $exec; then : # Do nothing if we are asked to execute the command line. +else + if test -s .id.ldobjs; then while read file; do - ldobjs="$ldobjs `nm $file | fgrep __id__init__ | awk '{print \"-u\", $3}'`" + ldobjs="$ldobjs `nm $file | fgrep __id__init__ | awk '{print \"-u\", $3}'`" done < .id.ldobjs -fi -rm -f .id.ldobjs - -$idmain && idflags="-m" - -if [ -z "$infile" ]; then - [ -z "$outfile" ] && fatal "no output file specified" -else - [ -z "$outfile" ] && outfile=${infile%.st}$soext - [ "$infile" = "$outfile" ] && fatal "input and output files are the same" - ccfile="${outfile}.c" -fi - -if $cckill; then - cckill="rm -f" -else - cckill="true" -fi - -trap "$run $cckill $ccfile; exit 1" 2 3 5 6 10 13 15 - -for lib in $idlibs; do - plibs="${plibs} ${prefix}${lib}" -done -idlibs="$plibs" -ccflags="$ccflags -I${prefix}" + fi + rm -f .id.ldobjs + + $idmain && idflags="-m" + + if [ -z "$infile" ]; then + [ -z "$outfile" ] && fatal "no output file specified" + else + [ -z "$outfile" ] && outfile=${infile%.st}$soext + [ "$infile" = "$outfile" ] && fatal "input and output files are the same" + ccfile="${outfile}.c" + fi + + if $cckill; then + cckill="rm -f" + else + cckill="true" + fi + + trap "$run $cckill $ccfile; exit 1" 2 3 5 6 10 13 15 + + for lib in $idlibs; do + plibs="${plibs} ${prefix}${lib}" + done + idlibs="$plibs" + ccflags="$ccflags -I${prefix}" +fi [ -z "$prefix" ] || { libfix=${prefix} @@ -242,6 +248,12 @@ ccflags="$ccflags -I${prefix}" export IDC_LIBDIR } +if $exec; then + # We've already set up the environment, so go ahead. + exec ${1+"$@"} + exit $? +fi + if [ ! -z "$infile" ]; then $verbose $run ${prefix}idc1 -I$prefix $idopts $idflags $infile -o $ccfile && diff -r 8a3813f99822 -r b7517504cb7a object/st80/Makefile.in --- a/object/st80/Makefile.in Tue Mar 11 22:05:55 2008 -0600 +++ b/object/st80/Makefile.in Tue Mar 11 22:06:44 2008 -0600 @@ -57,13 +57,13 @@ run : $(BIN)st80.so $(BIN)test-st80 .SUFFIXES : -$(BIN)%$(OBJEXT_SO) : %.st +$(BIN)%$(OBJEXT_SO) : %.st $(DEP) $(IDC) $(IINC) $(IDFLAGS) -s $< -o $@ -$(BIN)%$(OBJEXT_O) : %.st +$(BIN)%$(OBJEXT_O) : %.st $(DEP) $(IDC) $(IINC) $(IDFLAGS) -c $< -o $@ -$(BIN)%$(OBJEXT) : %.st +$(BIN)%$(OBJEXT) : %.st $(DEP) $(IDC) $(IINC) $(IDFLAGS) $< -o $@ install : all .FORCE _______________________________________________ fonc mailing list fonc@vpri.org http://vpri.org/mailman/listinfo/fonc