-# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.7 2001/08/08 13:21:04 qrczak Exp $
-
TOP=../..
include $(TOP)/mk/boilerplate.mk
-HS_PROG = genprimopcode
-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"