-# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.3 2000/10/23 11:08:22 simonmar Exp $
-
TOP=../..
include $(TOP)/mk/boilerplate.mk
-HS_PROG = genprimopcode
-INSTALL_PROGS += $(HS_PROG)
-SRC_HC_OPTS += -syslib text
+HS_PROG = genprimopcode
+
+ghc_lt_504 = $(shell if (test $(GhcCanonVersion) -lt 504); then echo YES; else echo NO; fi)
+ifeq "$(ghc_lt_504)" "YES"
+SRC_HC_OPTS += -package text
+endif
+
+ghc_ge_601 = $(shell if (test $(GhcCanonVersion) -ge 601); then echo YES; else echo NO; fi)
+ifeq "$(ghc_ge_601)" "YES"
+SRC_HC_OPTS += -package parsec
+endif
# genprimopcode is needed to boot in ghc/compiler...
+ifneq "$(BootingFromHc)" "YES"
boot :: all
+endif
include $(TOP)/mk/target.mk