[project @ 2002-06-24 14:35:44 by simonmar]
[ghc-hetmet.git] / mk / paths.mk
index 5b3c637..50c26e1 100644 (file)
@@ -22,6 +22,7 @@
 #  INSTALL_LIBS     (installed in $(libdir))
 #  INSTALL_LIBEXECS (installed in $(libexecdir))
 #  INSTALL_DATAS    (installed in $(datadir))
+#  INSTALL_IFACES   (installed in $(ifacedir))
 #
 # see target.mk for more information.
 #
@@ -61,9 +62,6 @@ INSTALL_DIR     = $(FPTOOLS_TOP)/glafp-utils/mkdirhier/mkdirhier
 # The install variables does not have any defaults,
 # what files to install have to be specified in the Makefiles.
 #
-#INSTALL_PROGS += $(HS_PROG) $(C_PROG)
-#INSTALL_LIBS  += $(LIBRARY)
-#INSTALL_DATAS += $(HS_IFACES)
 
 #################################################################################
 #
@@ -166,7 +164,10 @@ EXCLUDED_DERIVED_SRCS = $(patsubst %.hsc, %.hs, $(EXCLUDED_HSC_SRCS)) \
                        $(patsubst %.y,   %.hs, $(EXCLUDED_HAPPY_Y_SRCS)) \
                        $(patsubst %.ly,  %.hs, $(EXCLUDED_HAPPY_LY_SRCS)) \
                        $(patsubst %.hs,  %.hc, $(EXCLUDED_HS_SRCS)) \
-                       $(patsubst %.lhs, %.hc, $(EXCLUDED_LHS_SRCS))
+                       $(patsubst %.lhs, %.hc, $(EXCLUDED_LHS_SRCS)) \
+                       $(patsubst %.hs,  %_stub.c, $(EXCLUDED_HS_SRCS)) \
+                       $(patsubst %.lhs, %_stub.c, $(EXCLUDED_LHS_SRCS))
+
 # Exclude _hsc.c files; they get built as part of the cbits library,
 # not part of the main library
 
@@ -181,7 +182,14 @@ HS_IFACES   = $(addsuffix .$(way_)hi,$(basename $(HS_SRCS)))
 
 HSC_C_OBJS  = $(addsuffix _hsc.$(way_)o,$(basename $(filter %.hsc,$(SRCS))))
 
-C_SRCS      = $(filter %.c,$(SRCS))
+EXTRA_OBJS  = $(addsuffix .$(way_)o,$(basename $(EXTRA_SRCS)))
+
+# Always remove $(EXCLUDED_C_SRCS) from C_SRCS
+EXCLUDED_C_SRCS = $(patsubst %.lhs, %_stub.c, $(HS_SRCS)) \
+                 $(patsubst %.hs,  %_stub.c, $(HS_SRCS))
+
+
+C_SRCS      = $(filter-out $(EXCLUDED_C_SRCS),$(filter %.c,$(SRCS)))
 C_OBJS      = $(addsuffix .$(way_)o,$(basename $(C_SRCS)))
 
 # SCRIPT_SRCS:  list of raw script files (in literate form)
@@ -191,6 +199,9 @@ SCRIPT_OBJS = $(addsuffix .prl,$(basename $(SCRIPT_SRCS)))
 
 OBJS        = $(HS_OBJS) $(C_OBJS) $(SCRIPT_OBJS)
 
+# The default is for $(LIBOBJS) to be the same as $(OBJS)
+LIBOBJS            = $(OBJS)
+
 #
 # Note that as long as you use the standard variables for setting
 # which C & Haskell programs you want to work on, you don't have