[PATCH] pcmciautils: generate yacc_config.h

Daniel Ritz daniel.ritz at gmx.ch
Sat Jul 2 19:34:48 EDT 2005


hi dominik

yacc_config.h needs to be generated with yacc -d to make sure lex and
yacc have the same defines. otherwise it will compile fine and break
silently later when parsing config.opts (happend to me). i'm surprised
it didn't break for other people before.

attached patch fixes it. rule is stolen from pcmcia-cs. also please
do a rm src/yacc_config.h for distribution tarballs.

rgds
-daniel

--- pcmciautils-004/Makefile~	2005-07-03 00:24:00.000000000 +0200
+++ pcmciautils-004/Makefile	2005-07-03 00:19:16.000000000 +0200
@@ -108,6 +108,7 @@
 WARNINGS += -Wshadow
 
 CFLAGS := -pipe
+YFLAGS := -d
 
 HEADERS = \
 	src/cistpl.h	\
@@ -172,6 +173,12 @@
 
 .c.o:
 	$(QUIET) $(CC) $(CFLAGS) -c -o $@ $<
+
+%.c %.h : %.y
+	$(YACC) $(YFLAGS) $<
+	mv y.tab.c $*.c
+	mv y.tab.h $*.h
+
 	
 $(PCCARDCTL): $(LIBC) src/$(PCCARDCTL).o $(OBJS) $(HEADERS)
 	$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/$(PCCARDCTL).o $(LIB_OBJS) $(ARCH_LIB_OBJS)
@@ -203,7 +210,7 @@
 	 | xargs rm -f 
 	-rm -f $(PCCARDCTL) $(PCMCIA_CHECK_BROKEN_CIS) $(PCMCIA_SOCKET_STARTUP)
 	-rm -f $(CBDUMP) $(CISDUMP)
-	-rm -f src/yacc_config.c src/yacc_config.d src/lex_config.c src/lex_config.d
+	-rm -f src/yacc_config.c src/yacc_config.d src/lex_config.c src/lex_config.d src/yacc_config.h
 	-rm -f build/ccdv
 
 install-hotplug:



More information about the linux-pcmcia mailing list