1 ### Makefile for same-fringe implementations.
3 ###--------------------------------------------------------------------------
4 ### Notes about organization.
6 ### Most projects have lots of stuff in just a few languages, so it makes
7 ### sense to put the language configuration in one place. This one's
8 ### different. Its entire purpose is to demonstrate lots of different
11 ### So, at the top we declare the main targets; then each language has its
12 ### configuration and build rules.
17 TARGETS = $(patsubst %,%-fringe,$(LANGS))
18 CLEANFILES = $(TARGETS)
21 clean::; rm -f $(CLEANFILES)
23 ###--------------------------------------------------------------------------
29 for lang in $(LANGS); do \
30 echo >&3 "*** $$lang"; \
31 printf "Test $$lang..."; \
32 time=`command time -o/dev/stdout -f "%U user; %S system; %E" \
33 ./test ./$${lang}-fringe 2>&3`; \
34 if [ $$? -eq 0 ]; then \
35 win=$$(expr $$win + 1); \
36 printf " ok ($$time)\n"; \
38 lose=$$(expr $$lose + 1); \
42 if [ $$lose -eq 0 ]; then \
43 echo "All $$win test(s) OK"; \
45 echo "FAILED $$lose test(s)!"; \
49 ###--------------------------------------------------------------------------
53 wc -l $(SOURCES) | sort -n
55 ###--------------------------------------------------------------------------
59 CFLAGS = -O2 -g -pedantic -Wall
62 .c.o:; $(CC) -c $(CFLAGS) -o $@ $<
69 ###--------------------------------------------------------------------------
74 CLEANFILES += *.hi *.hc
76 .hs.o:; $(HC) -c $(HFLAGS) -o $@ $<
79 SOURCES += haskell-fringe.hs
80 haskell-fringe: haskell-fringe.o
83 ###--------------------------------------------------------------------------
90 SOURCES += icon-fringe.icn
91 icon-fringe: icon-fringe.icn
94 ###--------------------------------------------------------------------------
100 SOURCES += cl-fringe.lisp
101 cl-fringe: cl-fringe.lisp
102 ## cl-launch -R -o $@ -f `pwd`/$^ -- slow to start
103 cl-launch -o $@ -f `pwd`/$^ +I -r launch -d $@.core
105 ###--------------------------------------------------------------------------
111 .fs.exe:; fsc -o $@ $<
114 SOURCES += f\#-fringe.fs
115 f\#-fringe: f\#-fringe.exe
119 ###--------------------------------------------------------------------------
125 .scm.o:; $(SCMC) $(SCMFLAGS) -o $@ $<
128 SOURCES += scheme-fringe.scm
129 scheme-fringe: scheme-fringe.o
132 ###--------------------------------------------------------------------------
138 CLEANFILES += *.$(GOOBJ)
139 .SUFFIXES: .$(GOOBJ) .go
140 .go.$(GOOBJ):; $(GOC) $(GOFLAGS) $<
143 SOURCES += go-fringe.go
144 go-fringe: go-fringe.$(GOOBJ)
147 ###--------------------------------------------------------------------------
151 TARGETS += smalltalk-fringe.im
152 SOURCES += smalltalk-fringe.st
153 smalltalk-fringe.im: smalltalk-fringe.st
154 echo "ObjectMemory snapshot: '$@.new'" | gst $^ -
157 { echo '#! /bin/sh'; \
158 echo '"exec" "gst" "-I" "$@.im" "-f" "$$0" "$$@"'; \
159 echo 'ObjectMemory quit: (Node main: Smalltalk arguments)'; \
164 ###----- That's all, folks --------------------------------------------------