awips2/ncep/gov.noaa.nws.ncep.viz.rsc.ncgrid/dgdriv_c/link.mk
Steve Harris 7f90924706 12.4.1-10 baseline
Former-commit-id: 7fa9dbd5fb [formerly 4bfbdad17d] [formerly 9f8cb727a5] [formerly 7fa9dbd5fb [formerly 4bfbdad17d] [formerly 9f8cb727a5] [formerly 8485b90ff8 [formerly 9f8cb727a5 [formerly bf53d06834caa780226121334ac1bcf0534c3f16]]]]
Former-commit-id: 8485b90ff8
Former-commit-id: 40aa780b3d [formerly 33a67cdd82] [formerly 73930fb29d0c1e91204e76e6ebfdbe757414f319 [formerly a28d70b5c5]]
Former-commit-id: a16a1b4dd44fc344ee709abbe262aeed58a8339b [formerly e5543a0e86]
Former-commit-id: 0c25458510
2012-05-01 18:06:13 -05:00

88 lines
1.7 KiB
Makefile

.PHONY: link
#################################################################
# #
# PLEASE DO NOT MODIFY THIS FILE. #
# #
# link.mk #
# #
#################################################################
#
# Define BINDIR if not already defined.
#
BINDIR ?= $(PREFIX)/bin
#
# MAIN is the 'main' or 'PROGRAM' file name for this directory.
#
MAIN := $(filter $(LOCDIR).%, $(CSORCS) $(FSORCS))
ifeq "$(words $(MAIN))" "0"
MAIN := $(filter test%, $(CSORCS) $(FSORCS))
endif
#
# If a 'main' or 'PROGRAM' file exists continue processing.
#
ifeq "$(words $(MAIN))" "0"
link::
@echo "No 'main' or 'PROGRAM' module found..."
else
#
# Program names, PROGS, are determined from the '.mk' files.
#
PROGS := $(notdir $(basename $(wildcard $(SRCDIR)/*.mk)))
PROGS := $(filter-out cflags, $(PROGS))
#
# Check for the existence of program makefiles (*.mk).
#
ifeq "$(words $(PROGS))" "0"
#
# If no program makefiles (*.mk) exist
# get out of Dodge.
#
link::
@echo "No '*.mk' files found..."
else
#
# If program makefiles (*.mk) exist link
# the programs.
#
VPATH += $(LIBDIR) $(OS_LIB)
#
# Include the program specific library dependencies.
# The include file MUST contain the line:
# '$(BINDIR)/<program name>: -l....'
#
-include $(addprefix $(SRCDIR)/, $(addsuffix .mk, $(PROGS)))
link:: $(addprefix $(BINDIR)/, $(PROGS))
$(addprefix $(BINDIR)/, $(PROGS)): $(addsuffix .o, $(basename $(MAIN)))
@[[ -e $(BINDIR) ]] || mkdir -p $(BINDIR)
$(FC) $(LDFLAGS) -o $@ $+
#
# Force static files, '.a', to be loaded
# before shared files, '.so'.
#
.LIBPATTERNS = lib%.a lib%.so
#
# library dependencies
#
include $(GEMINC)/libdepends.mk
endif
endif
#
# End of link.mk
#