Make ghc-inplace work on Windows by adding FPTOOLS_TOP_ABS_UNIX to be always
the UNIX-style version of the path (for the Cygwin tools), and make CC_OPTS
be set even if there is no C_PROG, so that -mno-cygwin and -mwin32 are
always passed on Windows (and must be filtered out where not needed, e.g. in
lndir.c).
# FPTOOLS_TOP: the top of the fptools hierarchy, absolute path.
FPTOOLS_TOP_ABS = @hardtop@
+FPTOOLS_TOP_ABS_UNIX = @hardtop@
ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
FPTOOLS_TOP_ABS = $(subst \,/,$(shell cygpath -w @hardtop@))
endif
#----------------------------------------
# C programs
-ifneq "$(C_PROG)" ""
-all :: $(C_PROG)
-
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-CC_OPTS += -mno-cygwin
+CC_OPTS += -mno-cygwin -mwin32
endif
+ifneq "$(C_PROG)" ""
+all :: $(C_PROG)
+
$(C_PROG) :: $(C_OBJS)
$(CC) -o $@ $(CC_OPTS) $(LD_OPTS) $(C_OBJS) $(LIBS)
endif