### -*- Makefile -*- for Unix Jitter ### ### Author: Ian.Piumarta@inria.fr ### ### Last edited: Thu Feb 25 20:56:08 1999 by piumarta (Ian Piumarta) on pingu ### To build, type "make" followed by ONE or zero ("opt" is the default) of these: # # opt - standalone optimised Jitter (functions inlined, frame pointer # omitted, compiler optimisations enabled) # # dbg - standalone debuggable Jitter (functions not inlined in compiler, # frame pointer preserved, no compiler optimisations) # # optint - integrated optimised Jitter (then do "make j2" in the Squeak directory) # # dbgint - integrated debuggable Jitter (then do "make j2" in the Squeak directory) # ### ## the name of the Jitter module... MODNAME:= squeakCompiler ## the name of the default target: "dbg", "dbgint", "opt" or "optint"... default: j2opt ## path to the Squeak distribution... SQUEAK:= ../2.3 ## path to the world's best compiler... CXX:= /usr/egcs/bin/g++ #CXX:= g++ ## flags for everybody... CXXFLAGS+= -Wall -Wno-unused -Wno-pointer-arith -gstabs+ -fno-exceptions DBGFLAGS+= -fno-inline-functions OPTFLAGS+= -O9 -DNDEBUG LDFLAGS+= -g -r SHFLAGS+= -g -rdynamic -shared ## platform specifics... UTSMAC:= $(patsubst i%86,i386,$(shell uname -m)) ifeq ($(UTSMAC),i386) OPTFLAGS+= -fomit-frame-pointer OPTFLAGS+= -malign-loops=2 -malign-jumps=3 -malign-functions=2 endif ifeq ($(UTSMAC),ppc) OPTFLAGS+= -fno-cse-follow-jumps MODFLAGS:= -fpic endif ## some handy stuff that we generate and/or snarf from Squeak... SQCAT:= $(SQUEAK)/util/sqcat SQHDR:= sqVirtualMachine.h sq.h SQPRIMDECL:= primitiveTable.decl SQPRIMDEFN:= primitiveTable.defn ## minimal set of files required to build the Jitter module MODSRC:= module.cc ## set of files required to build the Jitter itself JITSRC:= $(filter-out $(MODSRC), $(wildcard *.cc)) MODOBJ:= $(MODSRC:.cc=.o) JITOBJ:= $(JITSRC:.cc=.o) HDR:= $(wildcard *.h) JIT:= $(MODNAME).o MOD:= $(MODNAME).so DEPDIR:= dep DEPENDENCIES:= $(addprefix $(DEPDIR)/, $(MODSRC)) $(addprefix $(DEPDIR)/, $(JITSRC)) CXXFLAGS+= $(OPTFLAGS) $(JITFLAGS) ## top-level targets... # Jitter included in standalone module dbg: $(MAKE) OPTFLAGS="$(DBGFLAGS)" MODOBJ="$(MODOBJ) $(JIT)" JITFLAGS=$(MODFLAGS) all opt: $(MAKE) MODOBJ="$(MODOBJ) $(JIT)" JITFLAGS=$(MODFLAGS) all # Jitter integrated into Squeak VM dbgint: $(MAKE) OPTFLAGS="$(DBGFLAGS)" all optint: $(MAKE) all dbgspy: $(MAKE) OPTFLAGS="$(DBGFLAGS) -DSPY" all optspy: $(MAKE) OPTFLAGS="$(OPFLAGS) -DSPY" all ## internal targets, not for casual use.... all: $(JIT) $(MOD) $(MOD): $(MODOBJ) $(CXX) $(SHFLAGS) -o $@ $(MODOBJ) $(JIT): $(JITOBJ) $(LD) $(LDFLAGS) -o $@ $(JITOBJ) module.o: module.cc $(CXX) $(CXXFLAGS) $(MODFLAGS) -c $< version.h:: ./verstamp $@ `cat VERSION` $(CXX) $(SQHDR): ln -sf $(SQUEAK)/src/$@ . $(SQPRIMDECL): $(SQUEAK)/$(SQPRIMDECL) $(SQCAT) $< > $@ $(SQPRIMDEFN): $(SQUEAK)/$(SQPRIMDEFN) $(SQCAT) $< > $@ vm.h: $(SQUEAK)/interp.c $(SQCAT) $< | ./mkvmh > $@ ## housekeeping... tidy: -/bin/rm -f *.o *~ core a.out main clean: tidy /bin/rm -rf $(SQHDR) $(DEPDIR) spotless: clean /bin/rm -f $(MOD) $(LIB) ## remake the lot if the Makefile changes # #$(JITOBJ) $(MODOBJ): GNUmakefile ## dependencies... dep/.stamp: mkdir dep touch dep/.stamp dep/%.cc: %.cc dep/.stamp $(SQHDR) $(SQPRIMDECL) $(SQPRIMDEFN) $(CXX) $(CXXFLAGS) -DEPEND -MM $< > $@ include $(DEPENDENCIES) ## these are for the benefit of Jitter hackers, and can safely be ignored... j2: dbgint $(MAKE) -C $(SQUEAK) j2 j2opt: optint $(MAKE) -C $(SQUEAK) j2 j2spy: dbgspy $(MAKE) -C $(SQUEAK) j2 j2optspy: optspy $(MAKE) -C $(SQUEAK) j2