# -*- Makefile -*- #---------------------------------------------------------------------------- # GNU Makefile # # @file GNUmakefile.TAO_IDL_FE # # $Id: gnu.mpd 82648 2008-08-21 06:55:54Z johnnyw $ # # This file was automatically generated by MPC. Any changes made directly to # this file will be lost the next time it is generated. # #---------------------------------------------------------------------------- MAKEFILE = GNUmakefile.TAO_IDL_FE DEPENDENCY_FILE = .depend.TAO_IDL_FE ## LIB may be set to empty later on in this file LIB_UNCHECKED = libTAO_IDL_FE.a LIB = $(LIB_UNCHECKED) LIB_NAME = libTAO_IDL_FE ## SHLIB may be set to empty later on in this file SHLIB_UNCHECKED = libTAO_IDL_FE.$(SOEXT) SHLIB = $(SHLIB_UNCHECKED) FILES = \ fe/fe_extern.cpp \ fe/fe_lookup.cpp \ fe/fe_global.cpp \ fe/fe_private.cpp \ fe/fe_declarator.cpp \ fe/fe_interface_header.cpp \ fe/y.tab.cpp \ fe/fe_init.cpp \ fe/lex.yy.cpp \ ast/ast_component.cpp \ ast/ast_predefined_type.cpp \ ast/ast_recursive.cpp \ ast/ast_enum.cpp \ ast/ast_structure.cpp \ ast/ast_redef.cpp \ ast/ast_expression.cpp \ ast/ast_typedef.cpp \ ast/ast_interface.cpp \ ast/ast_valuetype.cpp \ ast/ast_module.cpp \ ast/ast_interface_fwd.cpp \ ast/ast_root.cpp \ ast/ast_exception.cpp \ ast/ast_constant.cpp \ ast/ast_array.cpp \ ast/ast_attribute.cpp \ ast/ast_eventtype.cpp \ ast/ast_sequence.cpp \ ast/ast_concrete_type.cpp \ ast/ast_union_branch.cpp \ ast/ast_component_fwd.cpp \ ast/ast_field.cpp \ ast/ast_valuetype_fwd.cpp \ ast/ast_type.cpp \ ast/ast_decl.cpp \ ast/ast_native.cpp \ ast/ast_structure_fwd.cpp \ ast/ast_visitor.cpp \ ast/ast_eventtype_fwd.cpp \ ast/ast_home.cpp \ ast/ast_union_label.cpp \ ast/ast_argument.cpp \ ast/ast_generator.cpp \ ast/ast_check.cpp \ ast/ast_enum_val.cpp \ ast/ast_union.cpp \ ast/ast_factory.cpp \ ast/ast_valuebox.cpp \ ast/ast_union_fwd.cpp \ ast/ast_operation.cpp \ ast/ast_string.cpp \ util/utl_idlist.cpp \ util/utl_identifier.cpp \ util/utl_namelist.cpp \ util/utl_exprlist.cpp \ util/utl_strlist.cpp \ util/utl_global.cpp \ util/utl_decllist.cpp \ util/utl_list.cpp \ util/utl_scope.cpp \ util/utl_stack.cpp \ util/utl_exceptlist.cpp \ util/utl_err.cpp \ util/utl_string.cpp \ util/utl_indenter.cpp \ util/utl_labellist.cpp \ narrow/narrow.cpp VPATH = .:fe:narrow:util:ast #---------------------------------------------------------------------------- # Include macros and targets #---------------------------------------------------------------------------- ACE_SHLIBS = -lACE PRJ_TYPE = library INSLIB ?= $(ACE_ROOT)/lib ifeq ($(INSLIB),.) ifeq ($(PWD),) PWD=$(shell pwd) endif INSLIB = $(PWD) endif OUTPUT_DIRECTORY = $(INSLIB) include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU # To build multiple targets in the same directory on AIX, it works # best to have a template directory per project. # The compiler/linker isn't too smart about instantiating templates... ifdef TEMPINCDIR TEMPINCDIR := $(TEMPINCDIR)/TAO_IDL_FE all: $(TEMPINCDIR) endif ifneq ($(OUTPUT_DIRECTORY),) all: $(OUTPUT_DIRECTORY) $(OUTPUT_DIRECTORY): -@$(MKDIR) "$(OUTPUT_DIRECTORY)" endif # turn off libcheck if doing a dry run ifeq ($(findstring n, $(MAKEFLAGS)),n) LIBCHECK = 1 else # turn off libcheck if keep going was passed too ifeq ($(findstring k, $(MAKEFLAGS)),k) LIBCHECK = 1 else LIBCHECK ?= $(filter-out $(foreach lib,ACE,$(findstring $(lib),$(foreach libpath,. $(ACE_ROOT)/lib /usr/lib /usr/lib64 $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),ACE) ifeq ($(LIBCHECK),) LIBCHECK = 1 endif endif endif ifneq ($(LIBCHECK), 1) LIB = SHLIB = all: lib_warning endif LSRC = $(FILES) ifneq ($(CROSS-COMPILE),) all clean realclean idl_stubs depend lib_warning require_warning avoid_warning: @echo This project will not build on CROSS-COMPILE platforms. else include $(ACE_ROOT)/include/makeinclude/macros.GNU include $(ACE_ROOT)/include/makeinclude/rules.common.GNU include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU include $(ACE_ROOT)/include/makeinclude/rules.local.GNU ifeq ($(VXWORKSLINK),1) include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE) endif ifeq ($(VXWORKSLINK),1) LDLIBPATH = -L. -L$(ACE_ROOT)/lib else LDFLAGS += -L. -L$(ACE_ROOT)/lib endif CPPFLAGS += -I$(ACE_ROOT) -Iinclude -Ife ifeq ($(shared_libs),1) ifneq ($(SHLIB),) CPPFLAGS += -DTAO_IDL_FE_BUILD_DLL endif endif ifeq ($(static_libs),1) CPPFLAGS += -DACE_AS_STATIC_LIBS endif #---------------------------------------------------------------------------- # Local targets #---------------------------------------------------------------------------- fe/fe_lookup.cpp: fe/keywords.dat echo '// $$I''d$$' > $@ echo '' >> $@ echo '#include "fe_private.h"' >> $@ echo '#include "ace/OS_NS_string.h"' >> $@ echo '' >> $@ $(ACE_ROOT)/bin/gperf -M -J -c -C -D -E -T -f 0 -a -o -t -p -K keyword_ -L C++ -Z TAO_IDL_CPP_Keyword_Table -N lookup -k1,2,$$ $^ | \ sed -e 's/,}/,0}/g' \ -e 's/\*str == \*s && !strncmp/len == static_cast (ACE_OS::strlen (s)) \&\& *str == *s \&\& !ACE_OS::strncmp/g' \ >> $@ fe/lex.yy.cpp: fe/idl.ll @echo 'WARNING: Potentially outdated $@' @echo ' either touch(1) the file or explicitly' @echo ' generate it using:' @echo ' make lex.yy' .PHONY: lex.yy lex.yy: ifeq ($(notdir $(LEX)), flex) $(LEX) -L -t fe/idl.ll | \ sed -e 's/yy/tao_yy/g' \ -e 's/YY/TAO_YY/g' \ -e 's/ NULL/ 0/g' \ -e 's/ / /g' \ -e 's/ *$$//g' \ -e 's/TAO_YY_BREAK break;/TAO_YY_BREAK ACE_NOTREACHED (break;)/g' \ -e 's/ECHO/TAO_YY_ECHO/' \ -e 's/fread([^)]*)/static_cast (&)/g' \ -e 's/\$$Hea''der.*\$$/$$I''d$$/' \ -e 's@#include @#include "ace/os_include/os_stdio.h"@' \ -e 's@#include @#include "ace/os_include/os_ctype.h"@' \ -e '/#include fe/lex.yy.cpp (cd fe; patch < lex.yy.cpp.diff) else @echo 'ERROR: You must use flex 2.5.4 or higher to process this file' @/bin/false endif fe/y.tab.cpp: fe/idl.yy @echo 'WARNING: Potentially outdated $@' @echo ' either touch(1) the file or explicitly' @echo ' generate it using:' @echo ' make y.tab' .PHONY: y.tab y.tab: fe/idl.yy ifeq ($(notdir $(YACC)), bison) $(YACC) -y -l -d fe/idl.yy sed -e 's/char \*getenv/char *ace_foo/g' \ -e 's/= getenv/= ACE_OS::getenv/g' \ -e 's/int yynew_state,/int,/g' \ -e 's/int yyold_state,/int,/g' \ -e 's/int yyrule_num,/int,/g' \ -e 's/\(YYDEBUG_DISCARD_TOKEN.*int\) yytoken_num/\1/g' \ -e 's/yynewerror://g' \ -e 's/yy/tao_yy/g' \ -e 's/YY/TAO_YY/g' \ -e 's/ / /g' \ -e 's/ *$$//g' \ -e 's/y\.tab\.c/y.tab.cpp/g' \ -e 's%\(#pragma ident\)%// \1%' < y.tab.c > /tmp/$(USER).Y sed -e 's/yy/tao_yy/g' \ -e 's/YY/TAO_YY/g' < y.tab.h > /tmp/$(USER).YH echo '// $$I''d$$' > fe/y.tab.cpp cat /tmp/$(USER).Y >> fe/y.tab.cpp echo '// $$I''d$$' > fe/y.tab.h cat /tmp/$(USER).YH >> fe/y.tab.h $(RM) /tmp/$(USER).Y /tmp/$(USER).YH y.tab.c y.tab.h (cd fe; patch < y.tab.cpp.diff) else @echo 'ERROR: You must use bison 1.875b or higher to process this file' @/bin/false endif lib_warning: @echo TAO_IDL_FE will not be built due to the following missing library: @echo $(LIBCHECK) ## Some OS's have /bin/test others only have /usr/bin/test ifeq ($(wildcard /bin/test), /bin/test) TEST_EXE = /bin/test else ifeq ($(wildcard /usr/bin/test), /usr/bin/test) TEST_EXE = /usr/bin/test endif endif ifneq ($(GENERATED_DIRTY),) .PRECIOUS: $(GENERATED_DIRTY) ## If the generated files are anything but source files, we need to ## ensure that those files are generated before we attempt to build anything ## else. ifeq ($(OBJS_DEPEND_ON_GENERATED),1) $(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY) $(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY) endif endif realclean: clean ifneq ($(GENERATED_DIRTY),) -$(RM) -r $(GENERATED_DIRTY) endif __prebuild__: @-: endif # CROSS-COMPILE