This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] - Rules to keep objective C and C parsers synched


How about this (I haven't checked that it does the right thing 
in all cases) ?

Design parameter:  I assume it's better to put the generated objc-* files
in the main directory, since they are now required by C rules, and kept
in synch the proper way (with complete dependencies).

I don't think the overhead for people wanting to build only C is a problem,
is it ?

gcc changelog
Sun Jul  2 16:03:06 CEST 2000	Marc Espie <espie@openbsd.org>
	* Makefile.in:  Generate objc parser along with the C parser.
	* objc-parse.[ych]:  Moved from objective C directory.

objc changelog
Sun Jul  2 16:03:06 CEST 2000	Marc Espie <espie@openbsd.org>
	* Make-lang.in:  Remove generation of objc parser.
	* objc-parse.[ych]:  Move to parent dir.

*** gcc/Makefile.in.orig	Sun Jul  2 15:48:37 2000
--- gcc/Makefile.in	Sun Jul  2 15:59:27 2000
***************
*** 1071,1085 ****
      $(srcdir)/c-parse.h c-tree.h c-common.h input.h flags.h system.h \
      toplev.h output.h
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
! $(srcdir)/c-parse.h: $(srcdir)/c-parse.c
! $(srcdir)/c-parse.c: $(srcdir)/c-parse.y
  	cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o c-parse.c c-parse.y
! $(srcdir)/c-parse.y: c-parse.in
  	echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
  	sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
  	  -e "/^ifc$$/d" -e "/^end ifc$$/d" \
  	  $(srcdir)/c-parse.in >>tmp-c-parse.y
  	$(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
  
  $(srcdir)/c-gperf.h: c-parse.gperf
  	gperf -L C -F ', 0, 0' -p -j1 -i 1 -g -o -t -G -N is_reserved_word \
--- 1071,1093 ----
      $(srcdir)/c-parse.h c-tree.h c-common.h input.h flags.h system.h \
      toplev.h output.h
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
! 
! $(srcdir)/c-parse.h $(srcdir)/c-parse.c $(srcdir)/objc-parse.c: \
!     $(srcdir)/c-parse.y $(srcdir)/objc-parse.y
  	cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o c-parse.c c-parse.y
! 	cd $(srcdir); $(BISON) $(BISONFLAGS) -o objc-parse.c objc-parse.y
! 
! $(srcdir)/c-parse.y $(srcdir)/objc-parse.y: c-parse.in
  	echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
  	sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
  	  -e "/^ifc$$/d" -e "/^end ifc$$/d" \
  	  $(srcdir)/c-parse.in >>tmp-c-parse.y
  	$(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
+ 	echo '/*WARNING: This file is automatically generated!*/' >tmp-objc-prs.y
+ 	sed -e "/^ifc$$/,/^end ifc$$/d" \
+ 	  -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
+ 	  $(srcdir)/c-parse.in >>tmp-objc-prs.y
+ 	$(SHELL) $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc-parse.y
  
  $(srcdir)/c-gperf.h: c-parse.gperf
  	gperf -L C -F ', 0, 0' -p -j1 -i 1 -g -o -t -G -N is_reserved_word \
***************
*** 2159,2164 ****
--- 2167,2173 ----
  	-rm -f gthr-default.h
  	-rm -f */stage1 */stage2 */stage3 */stage4 */include
  	-rm -f c-parse.output
+ 	-rm -f objc-parse.output
  	-rm -f *.asm
  	-rm -f float.h
  	-rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
***************
*** 2194,2199 ****
--- 2203,2210 ----
  	$(MAKE) INTL_DISTCLEAN= INTL_CLEAN= INTL_MOSTLYCLEAN= \
  		intl.maintainer-clean lang.maintainer-clean distclean
  	-rm -f c-parse.y c-gperf.h
+ 	-rm -f objc-parse.y
+ 	-rm -f objc-parse.c objc-parse.output
  	-rm -f c-parse.c c-parse.h c-parse.output TAGS
  	-rm -f cpp.info* cpp.??s cpp.*aux
  	-rm -f gcc.info* gcc.??s gcc.*aux
*** gcc/objc/Make-lang.in.orig	Sun Jul  2 15:49:35 2000
--- gcc/objc/Make-lang.in	Sun Jul  2 15:59:24 2000
***************
*** 64,88 ****
  
  # Objective C language specific files.
  
! objc-parse.o : $(srcdir)/objc/objc-parse.c \
     $(CONFIG_H) $(TREE_H) $(srcdir)/toplev.h $(srcdir)/ggc.h \
     $(srcdir)/c-lex.h $(srcdir)/c-tree.h $(srcdir)/c-common.h \
     $(srcdir)/input.h $(srcdir)/flags.h $(srcdir)/output.h \
     $(srcdir)/objc/objc-act.h system.h
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
! 	-c $(srcdir)/objc/objc-parse.c
! 
! $(INTL_TARGETS): $(srcdir)/objc/objc-parse.c
! $(srcdir)/objc/objc-parse.c : $(srcdir)/objc/objc-parse.y
! 	cd $(srcdir)/objc; \
! 	$(BISON) $(BISONFLAGS) -o objc-parse.c objc-parse.y
  
! $(srcdir)/objc/objc-parse.y: $(srcdir)/c-parse.in
! 	echo '/*WARNING: This file is automatically generated!*/' >tmp-objc-prs.y
! 	sed -e "/^ifc$$/,/^end ifc$$/d" \
! 	  -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
! 	  $(srcdir)/c-parse.in >>tmp-objc-prs.y
! 	$(SHELL) $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc/objc-parse.y
  
  objc-act.o : $(srcdir)/objc/objc-act.c \
     $(CONFIG_H) $(TREE_H) $(RTL_H) system.h \
--- 64,78 ----
  
  # Objective C language specific files.
  
! objc-parse.o : $(srcdir)/objc-parse.c \
     $(CONFIG_H) $(TREE_H) $(srcdir)/toplev.h $(srcdir)/ggc.h \
     $(srcdir)/c-lex.h $(srcdir)/c-tree.h $(srcdir)/c-common.h \
     $(srcdir)/input.h $(srcdir)/flags.h $(srcdir)/output.h \
     $(srcdir)/objc/objc-act.h system.h
  	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
! 	-c $(srcdir)/objc-parse.c
  
! $(INTL_TARGETS): $(srcdir)/objc-parse.c
  
  objc-act.o : $(srcdir)/objc/objc-act.c \
     $(CONFIG_H) $(TREE_H) $(RTL_H) system.h \
***************
*** 129,139 ****
  objc.distclean:
  	-rm -f objc/Makefile objc/Make-host objc/Make-target
  	-rm -f objc/config.status objc/config.cache
- 	-rm -f objc-parse.output
  objc.extraclean:
  objc.maintainer-clean:
- 	-rm -f objc/objc-parse.y
- 	-rm -f objc/objc-parse.c objc/objc-parse.output
  
  #
  # Stage hooks:
--- 119,126 ----

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]