summaryrefslogtreecommitdiff
path: root/ghc/compiler/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/compiler/Makefile')
-rw-r--r--ghc/compiler/Makefile127
1 files changed, 22 insertions, 105 deletions
diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile
index 3dbe776010..ebd63f82e9 100644
--- a/ghc/compiler/Makefile
+++ b/ghc/compiler/Makefile
@@ -1,5 +1,5 @@
# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.59 1999/05/18 16:38:23 simonpj Exp $
+# $Id: Makefile,v 1.60 1999/06/01 16:40:41 simonmar Exp $
TOP = ..
include $(TOP)/mk/boilerplate.mk
@@ -17,12 +17,7 @@ endif
# -----------------------------------------------------------------------------
# Set HS_PROG, LIBRARY
-# Setting HS_PROG and LIBRARY causes all targets in target.mk
-# (included below) to kick in.
-LIBRARY=libhsp.a
-
-#
# Note: there have been reports of people running up against the ARG_MAX limit
# when linking hsc with all its constituent object files. The likely source of
# the problem is that the environment is a bit too big, so a workaround could
@@ -49,7 +44,7 @@ $(HS_PROG) :: $(HS_SRCS)
DIRS = \
utils basicTypes types hsSyn prelude rename typecheck deSugar coreSyn \
specialise simplCore stranal stgSyn simplStg codeGen absCSyn main \
- reader profiling parser usageSP cprAnalysis
+ profiling parser usageSP cprAnalysis
ifeq ($(GhcWithNativeCodeGen),YES)
@@ -59,47 +54,30 @@ SRC_HC_OPTS += -DOMIT_NATIVE_CODEGEN
endif
-HS_SRCS = $(SRCS_UGNHS) \
- $(foreach dir,$(DIRS),$(wildcard $(dir)/*.lhs))
+HS_SRCS = $(foreach dir,$(DIRS),$(wildcard $(dir)/*.lhs))
ifneq "$(GhcWithHscBuiltViaC)" "YES"
-HS_SRCS += rename/ParseIface.hs
+HS_SRCS += rename/ParseIface.hs parser/Parser.hs
endif
-# NB: it's no good to include *.hs in the top-line wildcard, because the .hs files
-# in parser/ may not have been created at that point.
-
HCS = $(patsubst %.lhs, %.hc, $(patsubst %.hs, %.hc, $(HS_SRCS)))
# ParseIface.hs ain't part of HS_SRCS when this is on..
ifeq "$(GhcWithHscBuiltViaC)" "YES"
-HCS += rename/ParseIface.hc
+HCS += rename/ParseIface.hc parser/Parser.hc
endif
HS_OBJS = \
$(patsubst %.hc, %.o, $(HCS)) \
- parser/hsclink.o parser/hschooks.o libhsp.a
+ parser/ctypes.o parser/hschooks.o
DESTDIR = $(INSTALL_LIBRARY_DIR_GHC)
-SRCS_UGN = $(wildcard parser/*.ugn)
-SRCS_UGNC = $(patsubst %.ugn, %.c, $(SRCS_UGN))
-SRCS_UGNH = $(patsubst %.ugn, %.h, $(SRCS_UGN))
-SRCS_UGNHS = $(patsubst parser/%.ugn, parser/U_%.hs, $(SRCS_UGN))
-SRCS_UGN_OBJS = $(patsubst %.c, %.o, $(SRCS_UGNC))
-
-#
-# Add the generated C files to the C_SRCS, so as to let `depend'
-# generate correct dependencies for them.
-#
-C_SRCS += $(SRCS_UGNC)
#
# Add misc .c helper code (used by the frontend.)
#
-C_SRCS += parser/ctypes.c parser/hschooks.c parser/hsclink.c \
- parser/id.c parser/infix.c parser/main.c parser/printtree.c \
- parser/syntax.c parser/type2context.c parser/util.c
+C_SRCS += parser/ctypes.c parser/hschooks.c
#
# Big Fudge to get around inherent problem that Makefile setup
@@ -107,11 +85,6 @@ C_SRCS += parser/ctypes.c parser/hschooks.c parser/hsclink.c \
#
SRC_MKDEPENDC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
-LIBOBJS = \
- $(SRCS_UGN_OBJS) parser/hslexer.o parser/hsparser.tab.o \
- parser/id.o parser/infix.o parser/syntax.o parser/type2context.o \
- parser/util.o parser/ctypes.o
-
# stuff you get for free in a source distribution
#
# SRC_DIST_FILES += rename/ParseIface.hs \
@@ -169,35 +142,20 @@ main/CmdLineOpts_HC_OPTS = -fvia-C -K6m
nativeGen/PprMach_HC_OPTS = -K2m
nativeGen/MachMisc_HC_OPTS = -K2m -fvia-C
nativeGen/MachCode_HC_OPTS = -H10m
-parser/UgenAll_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/UgenUtil_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_binding_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_constr_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_either_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_entidt_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_gdexp_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_grhsb_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_list_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_literal_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_match_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_maybe_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_qid_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_rulevar_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
-parser/U_tree_HC_OPTS = -H12m -fvia-C '-\#include"hspincl.h"'
-parser/U_ttype_HC_OPTS = -fvia-C '-\#include"hspincl.h"'
# Avoids Bug in 3.02, it seems
usageSP/UsageSPInf_HC_OPTS = -Onot
prelude/PrimOp_HC_OPTS = -H12m -K3m
-reader/Lex_HC_OPTS = -K2m -H16m -fvia-C
-
-# Heap was 6m with 2.10
-reader/ReadPrefix_HC_OPTS = -fvia-C '-\#include"hspincl.h"' -H10m
+parser/Lex_HC_OPTS = -K2m -H16m -fvia-C
-rename/ParseIface_HC_OPTS += -Onot -H45m -dcore-lint -fno-warn-incomplete-patterns
+# -dcore-lint is *temporary* to work around ghc space leak.
+rename/ParseIface_HC_OPTS += -Onot -H45m -dcore-lint -fno-warn-incomplete-patterns -dcore-lint
rename/ParseIface_HAPPY_OPTS += -g
+parser/Parser_HC_OPTS += -Onot -H45m -dcore-lint -fno-warn-incomplete-patterns -dcore-lint
+parser/Parser_HAPPY_OPTS += -g
+
ifeq "$(TARGETPLATFORM)" "hppa1.1-hp-hpux9"
rename/RnMonad_HC_OPTS = -fvia-C -O2 -O2-for-C
endif
@@ -266,22 +224,12 @@ simplStg/UpdAnal_HC_OPTS = -fno-strictness
# ----------------------------------------------------------------------------
# C compilations
-SRC_C_OPTS += -O -Iparser -I. -IcodeGen
+SRC_C_OPTS += -O -I. -IcodeGen
# ----------------------------------------------------------------------------
# Parsers/lexers
-# Main parser uses Yacc/Bison
-SRC_YACC_OPTS += -d -v
-# Suppress the generation of a default rule
-SRC_FLEX_OPTS += -s
-
-#
-# Want to keep the intermediate (included in src distribs).
-#
-.PRECIOUS: %.tab.c %.tab.h parser/hslexer.c
-
parser/hschooks.o : parser/hschooks.c
@$(RM) $@
$(HC) -c -o $@ -I$(GHC_INCLUDE_DIR) $(HC_OPTS) parser/hschooks.c
@@ -295,16 +243,10 @@ rename/ParseIface.hs : rename/ParseIface.y
$(HAPPY) $(HAPPY_OPTS) -g rename/ParseIface.y
@chmod 444 rename/ParseIface.hs
-#----------------------------------------------------------------------
-#
-# Building the stand-alone parser
-#
-all :: hsp
-
-hsp: parser/printtree.o parser/main.o libhsp.a
- $(CC) -o $@ $(CC_OPTS) $^
-
-CLEAN_FILES += hsp
+parser/Parser.hs : parser/Parser.y
+ @$(RM) parser/Parser.hs parser/ParseIface.hinfo
+ $(HAPPY) $(HAPPY_OPTS) -g parser/Parser.y
+ @chmod 444 parser/Parser.hs
#-----------------------------------------------------------------------------
# Linking
@@ -324,7 +266,7 @@ endif
# but put it together with the libraries.
# Also don't want any interface files intstalled
-INSTALL_LIBEXECS += hsc hsp
+INSTALL_LIBEXECS += hsc
#-----------------------------------------------------------------------------
# depend
@@ -332,7 +274,7 @@ INSTALL_LIBEXECS += hsc hsp
#
# Before doing `make depend', need to build all derived Haskell source files
#
-depend :: $(LOOPS) $(SRCS_UGNHS)
+depend :: $(LOOPS)
ifneq "$(GhcWithHscBuiltViaC)" "YES"
depend :: rename/ParseIface.hs
@@ -341,10 +283,7 @@ endif
#-----------------------------------------------------------------------------
# clean
-CLEAN_FILES += $(wildcard */*.$(way_)o */*.$(way_)hi) \
- $(SRCS_UGNC) $(SRCS_UGNH) \
- $(SRCS_UGNHS)\
- parser/hslexer.c parser/hsparser.tab.h parser/hsparser.tab.c
+CLEAN_FILES += $(wildcard */*.$(way_)o */*.$(way_)hi)
# Extra tidy, remove the .hc files (if you've got them).
MAINTAINER_CLEAN_FILES += $(wildcard */*.hc)
@@ -362,27 +301,5 @@ TAGS_C_SRCS=$(strip $(foreach f,$(foreach dir,$(DIRS),$(wildcard $(dir)/*.c)),$(
include $(TOP)/mk/target.mk
+parser/%.o : parser/%.c
-#
-# Special extra dependencies for yukky ugen stuff
-#
-
-parser/%.o : parser/%.c $(SRCS_UGNH)
-parser/hslexer.o : parser/hslexer.c parser/hsparser.tab.h
-
-parser/hspincl.h : $(SRCS_UGNH)
-parser/UgenAll.o : parser/hspincl.h
-parser/UgenUtil.o : parser/hspincl.h
-parser/U_constr.o : parser/hspincl.h
-parser/U_binding.o : parser/hspincl.h
-parser/U_pbinding.o : parser/hspincl.h
-parser/U_entidt.o : parser/hspincl.h
-parser/U_list.o : parser/hspincl.h
-parser/U_literal.o : parser/hspincl.h
-parser/U_maybe.o : parser/hspincl.h
-parser/U_either.o : parser/hspincl.h
-parser/U_qid.o : parser/hspincl.h
-parser/U_tree.o : parser/hspincl.h
-parser/U_ttype.o : parser/hspincl.h
-parser/printtree.o : parser/hspincl.h
-reader/ReadPrefix.o : parser/hspincl.h