+# -----------------------------------------------------------------------------
+# $Id: Makefile,v 1.8 2002/09/09 11:44:13 simonmar Exp $
+
TOP=../..
include $(TOP)/mk/boilerplate.mk
-INSTALL_PROGS += genprimopcode
+HS_PROG = genprimopcode
-SRC_HC_OPTS += -syslib text
-OBJS = Main.o
+ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi)
-CLEAN_FILES += genprimopcode
+ifeq "$(ghc_ge_504)" "NO"
+SRC_HC_OPTS += -package text
+endif
# genprimopcode is needed to boot in ghc/compiler...
+ifneq "$(BootingFromHc)" "YES"
boot :: all
-
-all :: genprimopcode
-
-genprimopcode: Main.o
- $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $(OBJS)
-
-CLEAN_FILES += genprimopcode
-CLEAN_FILES += $(OBJS)
+endif
include $(TOP)/mk/target.mk