Fixed newline characters throughout the code
[com/gs-lite.git] / src / ftacmp / Makefile
1 #!/bin/make
2
3 # ------------------------------------------------
4 #   Copyright 2014 AT&T Intellectual Property
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 # -------------------------------------------
17
18 #SHELL = /bin/sh
19
20 .SUFFIXES:.cpp .cc
21
22 CXX=g++
23
24 INCLUDES = -I../../include -I../../include/hfta
25 LDLIBS = -L../../lib -lm # -lgscphostaux 
26 C++OPTS = -ggdb  -D_BSD_SIGNALS $(INCLUDES) -DPREFILTER_OK -std=c++11 
27 C++LDOPTS = -ggdb 
28
29 # For Driver
30 CC_ARGS = \
31         -g 
32 #CC_OBJECT_FLAG = -o
33 #CC_COMPILE_FLAG = -c
34 #CC_EXECUTABLE_FLAG   = -o 
35
36 CPPFLAGS= $(C++OPTS)
37
38 TARGETS = translate_fta gen_tuple_access
39 SRCS = $(TARGETS:=.cpp)
40
41 # we need to suppress writable strings warnings on Mac for flex/bison generated C++ code
42 OS= $(shell uname -s)
43 ifeq ($(OS),Darwin)
44         WARN=-Wno-deprecated-writable-strings
45 endif
46 ifeq ($(OS),Linux)
47         WARN=-Wno-write-strings
48 endif
49
50 all: translate_fta gen_tuple_access interfacelib.a
51         cp interfacelib.a ../../lib/libgscpinterface.a ; ranlib ../../lib/libgscpinterface.a
52
53 default_targets: $(TARGETS)
54
55 %.tab.o: %.tab.cc
56         $(CXX) $(CPPFLAGS) $(WARN) $(INCLUDES) -c $< -o $@
57
58 %lexer.o: %lexer.cc
59         $(CXX) $(CPPFLAGS) $(WARN) $(INCLUDES) -c $< -o $@      
60
61 %.o: %.cc
62         $(CXX) $(CPPFLAGS) $(INCLUDES) -c $< -o $@
63
64 #FTA_OBJECTS:=analyze_fta.o ext_fcns.tab.o ext_fcnslexer.o fta.tab.o ftalexer.o generate_lfta_code.o generate_utils.o parse_schema.o query_plan.o stream_query.o translate_fta.o type_objects.o iface_q.o ifq.tab.o ifqlexer.o res.tab.o reslexer.o niclexer.o nic_def.o nic.tab.o generate_nic_code.o  partn.tab.o partnlexer.o niclexer.o parse_partn.o xmllexer.o xml.tab.o field_list.o
65
66 # without niclexer.o
67 FTA_OBJECTS:=analyze_fta.o ext_fcns.tab.o ext_fcnslexer.o fta.tab.o ftalexer.o generate_lfta_code.o generate_utils.o parse_schema.o query_plan.o stream_query.o translate_fta.o type_objects.o iface_q.o ifq.tab.o ifqlexer.o res.tab.o reslexer.o nic_def.o nic.tab.o generate_nic_code.o  partn.tab.o partnlexer.o niclexer.o parse_partn.o xmllexer.o xml.tab.o field_list.o
68
69
70 GEN_OBJECTS:=fta.tab.o ftalexer.o generate_utils.o parse_schema.o gen_tuple_access.o type_objects.o
71
72 LIB_OBJECTS:=fta.tab.o ftalexer.o parse_schema.o type_objects.o schemaparser.o
73
74 translate_fta: $(FTA_OBJECTS)
75         $(CXX) $(CC_ARGS) $(LDLIBS) $(CC_EXECUTABLE_FLAG) $(FTA_OBJECTS) -o $@
76
77 gen_tuple_access: $(GEN_OBJECTS)
78         $(CXX) $(CC_ARGS) $(LDLIBS) $(CC_EXECUTABLE_FLAG) $(GEN_OBJECTS) -o $@
79
80 interfacelib.a: $(LIB_OBJECTS)
81         ar -r $@ $(LIB_OBJECTS) 
82
83 #interfacelib.a: fta.tab.o ftalexer.o parse_schema.o type_objects.o schemaparser.o
84 #       ar -r $@  $?
85
86
87 test_interfacelib: test_interfacelib.o interfacelib.a
88         $(CXX) $(CC_ARGS) $(LDLIBS) $(CC_EXECUTABLE_FLAG) $(LIB_OBJECTS) $@
89
90 test_interfacelib.cc : schemaparser.h schemaparser_impl.h
91
92 # translate_fta source files
93 translate_fta.cc : parse_fta.h parse_schema.h parse_ext_fcns.h analyze_fta.h query_plan.h generate_lfta_code.h stream_query.h generate_utils.h nic_def.h generate_nic_code.h parse_partn.h print_plan.h
94
95 analyze_fta.cc : parse_fta.h parse_schema.h parse_ext_fcns.h analyze_fta.h type_objects.h 
96
97 ext_fcnslexer.cc : parse_ext_fcns.h ext_fcns.tab.cc.h 
98
99 fta.tab.cc : parse_fta.h parse_schema.h
100
101 ftalexer.cc : parse_fta.h parse_schema.h fta.tab.cc.h
102
103 generate_lfta_code.cc : parse_fta.h parse_schema.h analyze_fta.h generate_utils.h query_plan.h generate_lfta_code.h generate_nic_code.h
104
105 generate_utils.cc : generate_utils.h ../../include/lapp.h
106
107 parse_schema.cc : parse_fta.h parse_schema.h type_objects.h
108
109 query_plan.cc : query_plan.h analyze_fta.h generate_utils.h
110
111 stream_query.cc : stream_query.h generate_utils.h analyze_fta.h 
112
113 type_objects.cc : type_objects.h
114
115 iface_q.cc : iface_q.h
116
117 ifq.tab.cc : parse_fta.h
118
119 ifqlexer.cc : parse_fta.h ifq.tab.cc.h
120
121 res.tab.cc : iface_q.h
122
123 reslexer.cc : parse_fta.h res.tab.cc.h
124
125 niclexer.cc : nic_def.h nic.tab.cc.h
126
127 nic_def.cc : nic_def.h 
128
129 nic.tab.cc : nic_def.h 
130
131 generate_nic_code.cc : parse_fta.h parse_schema.h analyze_fta.h generate_utils.h query_plan.h generate_nic_code.h analyze_fta.h
132
133 partn.tab.cc : parse_partn.h
134
135 partnlexer.cc : parse_partn.h partn.tab.cc.h 
136
137 niclexer.cc : nic_def.h nic.tab.cc.h
138
139 parse_partn.cc : parse_partn.h parse_schema.h analyze_fta.h
140
141 xmllexer.cc : parse_fta.h xml.tab.hh 
142
143 xml.tab.cc : xml_t.h
144
145 field_list.cc : xml_t.h field_list.h
146
147 # gen_tuple_access source files
148 schemaparser.cc : schemaparser_impl.h ../../include/schemaparser.h parse_fta.h parse_schema.h generate_utils.h ../../include/hfta/host_tuple.h ../../include/lapp.h
149
150 clean:
151         rm -f *.o core $(TARGETS) ./ii_files/*.ii interfacelib.a ../../bin/gen_tuple_access ../../bin/translate_fta
152
153 del: 
154         rm -f core $(TARGETS)
155
156 cleandrive:
157         rm -f *.o *.a core driver ./ii_files/*.ii
158
159 install: all
160         cp translate_fta ../../bin/ ; cp gen_tuple_access ../../bin/ ; cp interfacelib.a ../../lib/libgscpinterface.a ; ranlib ../../lib/libgscpinterface.a
161
162 # DO NOT DELETE THIS LINE -- make depend depends on it.
163