[project @ 2004-11-09 16:59:31 by simonmar]
[ghc-hetmet.git] / ghc / utils / genprimopcode / Makefile
index 50c363b..2b1ecd9 100644 (file)
@@ -1,19 +1,21 @@
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
 
-INSTALL_PROGS += genprimopcode
+HS_PROG = genprimopcode
 
-SRC_HC_OPTS += -syslib text
-OBJS = Main.o
+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
 
-CLEAN_FILES += genprimopcode
+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
 
-all :: genprimopcode
-
-genprimopcode: Main.o
-       $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $(OBJS)
-
-CLEAN_FILES += genprimopcode
-CLEAN_FILES += $(OBJS)
+# genprimopcode is needed to boot in ghc/compiler...
+ifneq "$(BootingFromHc)" "YES"
+boot :: all
+endif
 
 include $(TOP)/mk/target.mk