]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blobdiff - tc/Makefile
iproute2: proper detection of libxtables position and flags
[lisovros/iproute2_canprio.git] / tc / Makefile
index 08aa4cefa02e856fcb5882094470166c20a24195..9cc1bf0f22ca95e7691badc0ffa9295882386b00 100644 (file)
@@ -89,6 +89,7 @@ endif
 
 YACC := bison
 LEX := flex
+CFLAGS += -DYY_NO_INPUT
 
 MODDESTDIR := $(DESTDIR)$(patsubst /usr%,%,$(LIBDIR))/tc
 
@@ -119,16 +120,16 @@ install: all
 
 clean:
        rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.yacc.h; \
-       rm -f emp_ematch.yacc.output
+       rm -f emp_ematch.yacc.*
 
 q_atm.so: q_atm.c
        $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
 
 m_xt.so: m_xt.c
-       $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c -lxtables
+       $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c $$(pkg-config xtables --cflags --libs)
 
 m_xt_old.so: m_xt_old.c
-       $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c -lxtables
+       $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c $$(pkg-config xtables --cflags --libs)
 
 %.yacc.c: %.y
        $(YACC) $(YACCFLAGS) -o $@ $<
@@ -136,6 +137,11 @@ m_xt_old.so: m_xt_old.c
 %.lex.c: %.l
        $(LEX) $(LEXFLAGS) -o$@ $<
 
+# our lexer includes the header from yacc, so make sure
+# we don't attempt to compile it before the header has
+# been generated as part of the yacc step.
+emp_ematch.lex.o: emp_ematch.yacc.c
+
 ifneq ($(SHARED_LIBS),y)
 
 tc: static-syms.o