source: ThirdParty/mpqc_open/src/lib/util/keyval/Makefile@ 1513599

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 1513599 was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 5.8 KB
Line 
1#
2# Makefile
3#
4# Copyright (C) 1996 Limit Point Systems, Inc.
5#
6# Author: Curtis Janssen <cljanss@ca.sandia.gov>
7# Maintainer: LPS
8#
9# This file is part of the SC Toolkit.
10#
11# The SC Toolkit is free software; you can redistribute it and/or modify
12# it under the terms of the GNU Library General Public License as published by
13# the Free Software Foundation; either version 2, or (at your option)
14# any later version.
15#
16# The SC Toolkit is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU Library General Public License for more details.
20#
21# You should have received a copy of the GNU Library General Public License
22# along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24#
25# The U.S. Government is granted a limited license as per AL 91-7.
26#
27
28TOPDIR=../../../..
29ifndef SRCDIR
30 BUILDING_IN_SRCDIR=yes
31 SRCDIR=$(shell pwd)
32endif
33
34LOCALMAKEFILE_OPTIONAL = yes
35include $(SRCDIR)/$(TOPDIR)/lib/GlobalMakefile
36
37ifeq ($(LOCALMAKEFILE_FOUND),yes)
38
39LD = $(CXX)
40
41CXXSRC = ipv2.cc ipv2_alloc.cc ipv2_cwk.cc ipv2_data.cc ipv2_error.cc \
42 ipv2_karray.cc ipv2_print.cc ipv2_read.cc \
43 keyval.cc keyvalipv2.cc keyvalval.cc keyvalass.cc \
44 keyvalstr.cc keyvalagg.cc keyvalpre.cc
45
46GENCXXSRC =ipv2_parse.cc ipv2_scan.cc
47
48TESTPROGS = keyvaltest
49
50LIBOBJ = $(CXXSRC:%.cc=%.$(OBJSUF)) $(GENCXXSRC:%.cc=%.$(OBJSUF))
51GENSRC = $(GENCXXSRC)
52
53INC = ipv2.h keyval.h ipv2_scan.h
54GENINC = ipv2_parse.h
55
56
57DEPENDINCLUDE = $(INC) $(GENINC)
58
59BIN_OR_LIB = LIB
60TARGET_TO_MAKE = libSCkeyval
61
62DISTFILES = Makefile $(CXXSRC) $(INC) ipv2_parse.yy ipv2_scan.ll LIBS.h
63
64default:: $(DEPENDINCLUDE)
65
66keyvaltest: keyvaltest.$(OBJSUF) libSCkeyval.$(LIBSUF) \
67 libSCcontainer.$(LIBSUF) \
68 libSCmisc.$(LIBSUF) libSCgroup.$(LIBSUF) \
69 libSCclass.$(LIBSUF) libSCstate.$(LIBSUF) \
70 libSCref.$(LIBSUF)
71 $(LTLINK) $(LD) $(LDFLAGS) -o keyvaltest $^ $(SYSLIBS) $(LTLINKBINOPTS)
72
73keyvaltest.$(OBJSUF): keyvaltest.cc
74 $(LTCOMP) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DSRCDIR=\"$(SRCDIR)\" -c $<
75
76include $(SRCDIR)/$(TOPDIR)/lib/GlobalRules
77
78distclean::
79 /bin/rm -f keyvaltest ipv2_parse.output
80
81$(LIBOBJ:.$(OBJSUF)=.d): $(DEPENDINCLUDE)
82OTHEROBJ = keyvaltest.$(OBJSUF)
83ifneq ($(DODEPEND),no)
84include $(LIBOBJ:.$(OBJSUF)=.d) $(OTHEROBJ:.$(OBJSUF)=.d)
85endif
86
87ifneq ($(BUILDING_IN_SRCDIR),yes)
88ifeq ($(wildcard ipv2_parse.cc),ipv2_parse.cc)
89$(error "ipv2_parse.cc exists in an object directory. This is now longer necessary or allowed. Delete the file to continue.")
90endif
91ifeq ($(wildcard ipv2_scan.cc),ipv2_scan.cc)
92$(error "ipv2_scan.cc exists in an object directory. This is now longer necessary or allowed. Delete the file to continue.")
93endif
94ifeq ($(wildcard ipv2_parse.h),ipv2_parse.h)
95$(error "ipv2_parse.h exists in an object directory. This is now longer necessary or allowed. Delete the file to continue.")
96endif
97endif
98
99$(SRCDIR)/ipv2_parse.cc: $(SRCDIR)/ipv2_parse.yy
100 @echo WARNING: The file $@ is out of date.
101 @echo It can be built by running \"make parser DODEPEND=no\" in the source directory.
102 @echo You may also get the message on files checked out of CVS, in which case you can touch $@ to stop getting this message.
103
104$(SRCDIR)/ipv2_parse.h: $(SRCDIR)/ipv2_parse.yy
105 @echo WARNING: The file $@ is out of date.
106 @echo It can be built by running \"make parser DODEPEND=no\" in the source directory.
107 @echo You may also get the message on files checked out of CVS, in which case you can touch $@ to stop getting this message.
108
109$(SRCDIR)/ipv2_scan.cc: $(SRCDIR)/ipv2_scan.ll
110 @echo WARNING: The file $@ is out of date.
111 @echo It can be built by running \"make scanner DODEPEND=no\" in the source directory.
112 @echo You may also get the message on files checked out of CVS, in which case you can touch $@ to stop getting this message.
113
114endif
115
116ifndef FLEX
117FLEX=flex
118endif
119
120ifndef BISON
121BISON=bison
122endif
123
124notobjdir_default:
125 @echo "Building in an unconfigured source directory."
126 @echo "The following make targets are available:"
127 @echo " make FLEX=<flex> scanner"
128 @echo " make BISON=<bison> parser"
129 @echo "Be sure to replace FlexLexer.h in the include"
130 @echo "directory with the correct version."
131
132#### yacc and lex ####
133# (only works with bison and flex)
134.PHONY: parser
135parser::
136 $(BISON) -v -d -o ipv2_parse.tmp.cc $^ ipv2_parse.yy
137 sed "s/^int yyparse.*;$$//" < ipv2_parse.tmp.cc \
138 | sed "s/^YYPARSE_RETURN_TYPE yyparse.*;$$//" \
139 | sed "s/__attribute__ ((__unused__))//" \
140 > ipv2_parse.cc
141 if test -f ipv2_parse.tmp.cc.h; then \
142 echo "Older bison detected."; \
143 /bin/mv ipv2_parse.tmp.cc.h ipv2_parse.h; \
144 /bin/mv ipv2_parse.tmp.cc.output ipv2_parse.output; \
145 else \
146 echo "Newer bison detected."; \
147 /bin/mv ipv2_parse.tmp.hh ipv2_parse.h; \
148 /bin/mv ipv2_parse.tmp.output ipv2_parse.output; \
149 fi
150 -@rm -f ipv2_parse.tmp*
151
152.PHONY: scanner
153scanner::
154 echo "#ifdef HAVE_CONFIG_H" > ipv2_scan.cc
155 echo "#include <scconfig.h>" >> ipv2_scan.cc
156 echo "#endif" >> ipv2_scan.cc
157 echo "#include <iostream>" >> ipv2_scan.cc
158 echo "#ifdef USING_NAMESPACE_STD" >> ipv2_scan.cc
159 echo "using namespace std;" >> ipv2_scan.cc
160 echo "#endif" >> ipv2_scan.cc
161 $(FLEX) -L -t ipv2_scan.ll | grep -v "extern FILE .yyin" \
162 | grep -v "static int yy_get_next_buffer.*;" \
163 | grep -v "static int yy_get_next_buffer.*;" \
164 | grep -v "class istream;" \
165 | sed "s/static int yy_get_next_buffer/int yy_get_next_buffer/" \
166 | grep -v "static void yyunput.*;" \
167 | sed "s/static void yyunput/void yyunput/" \
168 | grep -v "static int yyinput.*;" \
169 | grep -v "extern.*isatty" \
170 | sed "s/static int yyinput/int yyinput/" \
171 >> ipv2_scan.cc
Note: See TracBrowser for help on using the repository browser.