[ofa-general] [PATCH 5/7] osm: QoS - compiling policy file parser
Yevgeny Kliteynik
kliteyn at dev.mellanox.co.il
Mon Aug 20 05:08:08 PDT 2007
Compiling QoS policy file parser.
C & H files are generated from Lex & Yacc files and the
generated files are compiled.
Generated files are not included in git, but they do get
included in RPM as they are also created by 'make dist'.
Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
opensm/include/Makefile.am | 2 ++
opensm/opensm/Makefile.am | 28 +++++++++++++++++++++++++++-
opensm/opensm/configure.in | 2 ++
3 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/opensm/include/Makefile.am b/opensm/include/Makefile.am
index ea62507..b83205f 100644
--- a/opensm/include/Makefile.am
+++ b/opensm/include/Makefile.am
@@ -90,6 +90,8 @@ EXTRA_DIST = \
$(srcdir)/opensm/osm_state_mgr_ctrl.h \
$(srcdir)/opensm/osm_perfmgr.h \
$(srcdir)/opensm/osm_perfmgr_db.h \
+ $(srcdir)/opensm/osm_qos_policy.h \
+ $(srcdir)/opensm/osm_qos_parser_y.h \
$(srcdir)/complib/cl_thread_osd.h \
$(srcdir)/complib/cl_packon.h \
$(srcdir)/complib/cl_atomic_osd.h \
diff --git a/opensm/opensm/Makefile.am b/opensm/opensm/Makefile.am
index 6dfa824..6c7208d 100644
--- a/opensm/opensm/Makefile.am
+++ b/opensm/opensm/Makefile.am
@@ -56,7 +56,21 @@ opensm_SOURCES = main.c osm_console.c osm_db_files.c \
osm_ucast_lash.c osm_ucast_file.c osm_ucast_ftree.c \
osm_vl15intf.c osm_vl_arb_rcv.c \
st.c osm_perfmgr.c osm_perfmgr_db.c \
- osm_event_plugin.c osm_dump.c
+ osm_event_plugin.c osm_dump.c \
+ osm_qos_parser_y.c osm_qos_parser_l.c osm_qos_policy.c
+
+osm_qos_parser_y.c: $(srcdir)/osm_qos_parser.y $(srcdir)/../include/opensm/osm_qos_policy.h
+ $(YACC) -y -d $(srcdir)/osm_qos_parser.y
+ mv y.tab.c osm_qos_parser_y.c
+ mv y.tab.h osm_qos_parser_y.h
+ cp -f osm_qos_parser_y.c $(srcdir)/
+ cp -f osm_qos_parser_y.h $(srcdir)/../include/opensm/
+
+osm_qos_parser_l.c: $(srcdir)/osm_qos_parser.l $(srcdir)/../include/opensm/osm_qos_policy.h
+ $(LEX) $(srcdir)/osm_qos_parser.l
+ mv lex.yy.c osm_qos_parser_l.c
+ cp -f osm_qos_parser_l.c $(srcdir)/
+
if OSMV_OPENIB
opensm_CFLAGS = -Wall $(OSMV_CFLAGS) -fno-strict-aliasing -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
opensm_CXXFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
@@ -104,3 +118,15 @@ install-exec-hook:
if test -L $(DESTDIR)/$(libdir)/libopensm-$(VERSION).so; then rm $(DESTDIR)/$(libdir)/libopensm-$(VERSION).so; fi; \
lname=`\ls -l $(DESTDIR)/$(libdir)/libopensm.so | awk '{print $$NF}'`; \
ln -s $$lname $(DESTDIR)/$(libdir)/libopensm-$(VERSION).so
+
+# generate c and h files from the lex and yacc files
+dist-hook: $(srcdir)/osm_qos_parser.y $(srcdir)/osm_qos_parser.l
+ $(YACC) -y -d $(srcdir)/osm_qos_parser.y
+ mv y.tab.c osm_qos_parser_y.c
+ mv y.tab.h osm_qos_parser_y.h
+ cp -f osm_qos_parser_y.c $(srcdir)/
+ cp -f osm_qos_parser_y.h $(srcdir)/../include/opensm/
+ $(LEX) $(srcdir)/osm_qos_parser.l
+ mv lex.yy.c osm_qos_parser_l.c
+ cp -f osm_qos_parser_l.c $(srcdir)/
+
diff --git a/opensm/opensm/configure.in b/opensm/opensm/configure.in
index afb20b3..a49538d 100644
--- a/opensm/opensm/configure.in
+++ b/opensm/opensm/configure.in
@@ -22,6 +22,8 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
+AM_PROG_LEX
+AC_PROG_YACC
dnl Checks for libraries
--
1.5.1.4
More information about the general
mailing list