-# These settings are if you use a visual studio build
-CVS=cvs
+TOP = ../../..
+include $(TOP)/mk/boilerplate.mk
+
+WAYS=$(GhcLibWays)
+
+#-----------------------------------------------------------------------------
+# Setting the standard variables
+#
+
+HC = $(GHC_INPLACE)
+SRC_HC_OPTS+=-cpp -fglasgow-exts
+
+#-----------------------------------------------------------------------------
+#
CORENV_DEBUG=
CORENV_RETAIL=
LOCALRUN=./
-ILX_FAST=x
ifeq ($(HOSTNAME),MSRC-HILDA)
CORENV_DEBUG="call devcorb2gen.bat fastchecked"
CORENV_RETAIL="call devcorb2gen.bat free"
LOCALRUN=.\\
-ILX_FAST=
endif
ILX2IL_HOME=C:/devel/fcom/src
$(MAKE) -C $(ILX2IL_HOME) ilxdefault
prel: ilx
- $(MAKE) -C ../../../lib/std std.Onot.mono-b2.dll
-
-%.o: %.hs ../../ghc-4.11
- ../../ghc-inplace -o $@ -c $*.hs
+ $(MAKE) -C ../../../lib/std std.$(ilx_way).dll std.$(ilx_way).vlb
#========================================================================
-# 1. From Haskell to ILX
-
-%.Onot.ilx: %.hs ../../ghc-4.11
- ../../ghc-inplace -c -fglasgow-exts -o $@ -i../../../lib/std/.Onot -Onot -filx -fkeep-stg-types $*.hs -osuf Onot.ilx
-
-%.O.ilx: %.hs ../../ghc-4.11
- ../../ghc-inplace -c -fglasgow-exts -o $@ -i../../../lib/std/.O -O -filx -fkeep-stg-types $*.hs -osuf O.ilx
-
-../Entry.Onot.ilx: ../Entry.ilx
- sed -e "s|ilx std|ilx std.Onot|g" ../Entry.ilx > $@.tmp
- mv $@.tmp $@
-
-../Entry.O.ilx: ../Entry.ilx
- sed -e "s|ilx std|ilx std.O|g" ../Entry.ilx > $@.tmp
- mv $@.tmp $@
-
+# 1. From Haskell to ILX and then to IL - see build.mk
-#========================================================================
-# 2. From ILX to IL
+#------------------------------------------------------------------------
+# 2. From IL to .EXE
-%.generic.il: $(ILX2IL) %.ilx
- $(ILX2IL) --generic $(ILX2IL_FLAGS) -o $@.tmp $*.ilx
- mv $@.tmp $@
+%.$(ilx_way).exe : %.$(ilx_way).il ../Entry.$(ilx_way).il
+ cat $*.$(ilx_way).il ../Entry.$(ilx_way).il > $@.tmp
+ echo "call devcorb2gen free" > tmp.bat
+ echo "ilasm /DEBUG /QUIET /OUT=$@ $@.tmp" >> tmp.bat
+ cmd /c tmp.bat
-%.mono.il: $(ILX2IL) %.ilx
- $(ILX2IL) --mono $(ILX2IL_FLAGS) -o $@.tmp $*.ilx
+../Entry.$(hs2ilx_suffix)_o: ../Entry.ilx
+ sed -e "s|ilx std|ilx std.$(hs2ilx_suffix)|g" ../Entry.ilx > $@.tmp
mv $@.tmp $@
-#------------------------------------------------------------------------
-# From IL to .EXE
-%.generic.exe: %.generic.il ../Entry.Onot.generic.il
- cat $*.generic.il ../Entry.Onot.generic.il > $@.tmp
- echo "$(CORENV_RETAIL)" > $@.bat
- echo "ilasm /exe /quiet /out=$(subst /,\\,$@.tmp) $(subst /,\\,$@.tmp)" >> $@.bat
- time -p cmd /c $(subst /,\\,$@).bat
- rm $@.bat
+%.$(ilx_way).mvl: %.$(ilx_way).il
+ (ILVALID_HOME=c:\\devel\\fcom\\src\\ ILVALID_MSCORLIB=mscorlib.vlb $(ILVALID) c:\\devel\\fcom\\src\\bin\\msilxlib$(ilx2il_suffix).vlb $(TOP)/lib/std/std.$(ilx_way).vlb $<) 2>&1
-%.mono.exe: %.mono.il ../Entry.Onot.mono.il
- cat $*.mono.il ../Entry.Onot.mono.il > $@.tmp
- echo "$(CORENV_RETAIL)" > $@.bat
- echo "ilasm /exe /quiet /out=$(subst /,\\,$@.tmp) $(subst /,\\,$@.tmp)" >> $@.bat
- time -p cmd /c $(subst /,\\,$@).bat
- rm $@.bat
#------------------------------------------------------------------------
# From .HS to .EXE without using ILX
cp $< $@
%.debug.run: HSstd_cbits.dll %.exe
- echo "$(CORENV_DEBUG)" > $@.bat
- echo "set CORPATH=$(subst /,\\,$(ILX2IL_HOME))\\bin;\\GHC\\fptools\\ghc\\lib\\std;%CORPATH%" >> $@.bat
- echo "$(LOCALRUN)$(subst /,\\,$*).debug.exe 2>&1" >> $@.bat
- time -p cmd /c $(subst /,\\,$@).bat
- rm $@.bat
-
-%.retail.run: HSstd_cbits.dll %.exe
- echo "$(CORENV_RETAIL)" > $@.bat
- echo "set CORPATH=$(subst /,\\,$(ILX2IL_HOME))\\bin;\\GHC\\fptools\\ghc\\lib\\std;%CORPATH%" >> $@.bat
- echo "$(LOCALRUN)$(subst /,\\,$*).retail.exe 2>&1" >> $@.bat
+ cp $(TOP)/lib/std/*.dll .
+ cp $(TOP)/lib/std/*.pdb .
+ cp $(TOP)/lib/std/*.il .
+ cp $(ILX2IL_HOME)/bin/*.dll .
+ cp $(ILX2IL_HOME)/bin/*.pdb .
+ cp $(ILX2IL_HOME)/bin/*.il .
+ echo "call devcorb2gen free" > $@.bat
+ echo "$(LOCALRUN)$(subst /,\\,$*).exe 2>&1" >> $@.bat
time -p cmd /c $(subst /,\\,$@).bat
rm $@.bat
(cd ../..; $(CVS) up)
(cd ../../../lib/std; $(CVS) up)
-.PRECIOUS: %.mono-nonstatic.il %.fullgeneric-nonstatic.il %.fullgeneric.il %.nolib.il %.Onot.ilx %.O.ilx %.nolib.ilx %-nonstatic.ilx %.exe %.debug.exe %.dll %.O.exe
.PHONY: %.run
+
+include $(TOP)/mk/target.mk