KIM API V2
Makefile
Go to the documentation of this file.
1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the Common Development
5 # and Distribution License Version 1.0 (the "License").
6 #
7 # You can obtain a copy of the license at
8 # http://www.opensource.org/licenses/CDDL-1.0. See the License for the
9 # specific language governing permissions and limitations under the License.
10 #
11 # When distributing Covered Code, include this CDDL HEADER in each file and
12 # include the License file in a prominent location with the name LICENSE.CDDL.
13 # If applicable, add the following below this CDDL HEADER, with the fields
14 # enclosed by brackets "[]" replaced with your own identifying information:
15 #
16 # Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
17 #
18 # CDDL HEADER END
19 #
20 
21 #
22 # Copyright (c) 2013--2018, Regents of the University of Minnesota.
23 # All rights reserved.
24 #
25 # Contributors:
26 # Ryan S. Elliott
27 #
28 
29 
30 # load all basic KIM make configuration
31 ifneq (clean,$(MAKECMDGOALS))
32  ifeq ($(wildcard ../Makefile.KIM_Config_Helper),)
33  KIM_API_BUILD_HELPER = kim-api-v1-build-config
34  else
35  include ../Makefile.KIM_Config_Helper
36  endif
37  ifeq ($(shell $(KIM_API_BUILD_HELPER) --version 2> /dev/null),)
38  $(error $(KIM_API_BUILD_HELPER) utility is not available. Something is wrong with your KIM API package setup)
39  endif
40 endif
41 
42 CC = $(shell $(KIM_API_BUILD_HELPER) --cc)
43 CXX = $(shell $(KIM_API_BUILD_HELPER) --cxx)
44 FC = $(shell $(KIM_API_BUILD_HELPER) --fc)
45 LD = $(shell $(KIM_API_BUILD_HELPER) --ld)
46 INCLUDES = $(shell $(KIM_API_BUILD_HELPER) --includes)
47 CFLAGS = $(shell $(KIM_API_BUILD_HELPER) --cflags)
48 CXXFLAGS = $(shell $(KIM_API_BUILD_HELPER) --cxxflags)
49 FFLAGS = $(shell $(KIM_API_BUILD_HELPER) --fflags)
50 LDFLAGS = $(shell $(KIM_API_BUILD_HELPER) --ldflags)
51 LDLIBS = $(shell $(KIM_API_BUILD_HELPER) --ldlibs)
52 XLANGLDLIBS = $(shell $(KIM_API_BUILD_HELPER) --xlangldlibs)
53 FNOMAINFLAG = $(shell $(KIM_API_BUILD_HELPER) --fnomainflag)
54 OBJONLYFLAG = $(shell $(KIM_API_BUILD_HELPER) --objonlyflag)
55 OUTPUTINFLAG = $(shell $(KIM_API_BUILD_HELPER) --outputinflag)
56 
57 .PHONY: all clean
58 
59 TEST_NAME := ex_test_Ar_fcc_cluster_fortran
60 
61 all: $(TEST_NAME)
62 
63 $(TEST_NAME).o: $(TEST_NAME).F90 Makefile
64  $(FC) $(INCLUDES) $(FFLAGS) $(OBJONLYFLAG) $<
65 
66 $(TEST_NAME): $(TEST_NAME).o
67  $(LD) $(FNOMAINFLAG) $(LDFLAGS) $< $(LDLIBS) $(XLANGLDLIBS) $(OUTPUTINFLAG) $@
68 
69 clean:
70  rm -f $(TEST_NAME) $(TEST_NAME).o kim.log *.mod