blob: 2fa5f83e739f07c7f3bda2668f87e4f865814015 [file] [log] [blame]
##===- Makefile.f2c ----------------------------------------*- Makefile -*-===##
#
# Enable running Fortran programs with LLVM by using f2c to convert to C and
# link with libf2c, but only until we have a Fortran front-end.
#
##===----------------------------------------------------------------------===##
# FIXME: This would be autoconf'd
include $(LEVEL)/Makefile.config
ifndef TEST
all::
else
test::
endif
.PRECIOUS: %.c
ifeq ($(ARCH),x86)
F2C_DIR = /home/vadve/shared/localtools/x86
else
ifeq ($(ARCH),Sparc)
F2C_DIR = /home/vadve/shared/localtools/sparc
endif
endif
F2C = $(F2C_DIR)/bin/f2c
F2C_INC = $(F2C_DIR)/include
F2C_LIB = $(F2C_DIR)/lib
clean::
rm -f $(Source:%.f=%.c)
%.c: %.f
$(F2C) $< > /dev/null 2>&1
CPPFLAGS = -I$(F2C_INC)
LDFLAGS += -L$(F2C_LIB) -lf2c
# 'main' is defined in the f2c runtime library. The function exported from the
# program is named MAIN__
EXTRA_LINKTIME_OPT_FLAGS += -internalize-public-api-list=MAIN__