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 ###--------------------------------------------------------------------------
97 CLEANFILES
+= *.core
*.fasl
99 .SUFFIXES
: .lisp .fasl
100 .lisp.fasl
:; sbcl
--eval
'(quit :unix-status (if (compile-file "$<") 0 1))'
103 SOURCES
+= cl-fringe.lisp
104 cl-fringe
: cl-fringe.fasl
105 cp
$< $@.new
&& chmod
+x
$@.new
&& mv
$@.new
$@
106 ## cl-launch -o $@ -f `pwd`/$^ +I -r launch -d $@.core
108 ###--------------------------------------------------------------------------
114 .fs.exe
:; fsc
-o
$@
$<
117 SOURCES
+= f\
#-fringe.fs
118 f\
#-fringe: f\#-fringe.exe
122 ###--------------------------------------------------------------------------
128 .scm.o
:; $(SCMC
) $(SCMFLAGS
) -o
$@
$<
131 SOURCES
+= scheme-fringe.scm
132 scheme-fringe
: scheme-fringe.o
135 ###--------------------------------------------------------------------------
141 CLEANFILES
+= *.
$(GOOBJ
)
142 .SUFFIXES
: .
$(GOOBJ
) .go
143 .go.
$(GOOBJ
):; $(GOC
) $(GOFLAGS
) $<
146 SOURCES
+= go-fringe.go
147 go-fringe
: go-fringe.
$(GOOBJ
)
150 ###--------------------------------------------------------------------------
154 TARGETS
+= smalltalk-fringe.im
155 SOURCES
+= smalltalk-fringe.st
156 smalltalk-fringe.im
: smalltalk-fringe.st
157 echo
"ObjectMemory snapshot: '$@.new'" | gst
$^
-
160 { echo
'#! /bin/sh'; \
161 echo
'"exec" "gst" "-I" "$@.im" "-f" "$$0" "$$@"'; \
162 echo
'ObjectMemory quit: (Node main: Smalltalk arguments)'; \
167 ###----- That's all, folks --------------------------------------------------