Commit 4b2cb594 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-11-06 11:05:22 by simonmar]

Make compilation of javaGen conditional on $(GhcWithJavaGen) in the
same way as the ILX and native backends.
parent 81f020eb
# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.196 2001/11/03 01:44:04 sof Exp $
# $Id: Makefile,v 1.197 2001/11/06 11:05:22 simonmar Exp $
TOP = ..
include $(TOP)/mk/boilerplate.mk
......@@ -90,7 +90,7 @@ CLEAN_FILES += $(CONFIG_HS)
DIRS = \
utils basicTypes types hsSyn prelude rename typecheck deSugar coreSyn \
specialise simplCore stranal stgSyn simplStg codeGen absCSyn main \
profiling parser usageSP cprAnalysis javaGen compMan
profiling parser usageSP cprAnalysis compMan
ifeq ($(GhcWithNativeCodeGen),YES)
DIRS += nativeGen
......@@ -103,6 +103,11 @@ DIRS += ilxGen
SRC_HC_OPTS += -DILX
endif
ifeq ($(GhcWithJavaGen),YES)
DIRS += javaGen
SRC_HC_OPTS += -DJAVA
endif
#
# Canonicalize the GHC version number - assume it is has the form x.yy.[z] or
# x.yy[.date] where date = yyyymmdd
......
......@@ -17,8 +17,10 @@ import AsmCodeGen ( nativeCodeGen )
import IlxGen ( ilxGen )
#endif
#ifdef JAVA
import JavaGen ( javaGen )
import qualified PrintJava
#endif
import DriverState ( v_HCHeader )
import TyCon ( TyCon )
......@@ -73,8 +75,13 @@ codeOutput dflags mod_name tycons core_binds stg_binds
>> return stub_names
HscC -> outputC dflags filenm flat_abstractC stub_names
>> return stub_names
HscJava -> outputJava dflags filenm mod_name tycons core_binds
HscJava ->
#ifdef JAVA
outputJava dflags filenm mod_name tycons core_binds
>> return stub_names
#else
panic "Java support not compiled into this ghc"
#endif
HscILX ->
#ifdef ILX
outputIlx dflags filenm mod_name tycons stg_binds
......@@ -147,6 +154,7 @@ outputAsm dflags filenm flat_absC
%************************************************************************
\begin{code}
#ifdef JAVA
outputJava dflags filenm mod tycons core_binds
= doOutput filenm (\ f -> printForUser f alwaysQualify pp_java)
-- User style printing for now to keep indentation
......@@ -155,6 +163,7 @@ outputJava dflags filenm mod tycons core_binds
-- Make sure we have up to date dead-var information
java_code = javaGen mod [{- Should be imports-}] tycons occ_anal_binds
pp_java = PrintJava.compilationUnit java_code
#endif
\end{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment