I am using the hpux ported/pre-compiled gmake, version 3.77
under HPUX 11.00, and I am running into some unexpected 
behaviour.  Any help would be appreciated.

I have a Pattern rule defined, and within that pattern rule, I need
to check for the existance of another file, and slightly change
the "build" step to include the file if it exists.  I have included
my makefile below.

To use this, first do a 'make initial'.  This will create (touch) all
the required files.  Then, each successive invocation of 
make will touch the proper files to re-run the tests.  This
is only a demo Makefile, but it demonstrates the problem I
am experienceing.

The area I am concerned about is in the middle of the 
output where it says:
findicf = ""
making with icf file ""
making with icf file ""

Both of these lines should say:
making WITHOUT icf file ""
making WITHOUT icf file""

If anyone has any clues, or insights, I would appreciate them

Thanks.

------------------------------------------------------------------------------
---------------------------
Makefile begins here
------------------------------------------------------------------------------
---------------------------
#----------------------------------------------------------------------------#
# $RCSfile: Makefile,v $
# $Date: 2000/04/27 21:50:48 $
# $Revision: 1.22 $
# $Purpose: makefile for ASR Database Server
# $Comments: $  Test some auto-checkout Features
#----------------------------------------------------------------------------#
# rcs_ident: $Id: Makefile,v 1.22 2000/04/27 21:50:48 commpg Exp $
#----------------------------------------------------------------------------#

#-- include common make rules
        ICFS := \
                AsrDbServer.icf 

        IDLS := \
                AsrDbServer.idl \
                AsrData.idl 

        GENERATED := \
                $(addsuffix _c.h,$(basename $(IDLS))) \
                $(addsuffix _c.cpp,$(basename $(IDLS))) \
                $(addsuffix _s.h,$(basename $(IDLS))) \
                $(addsuffix _s.cpp,$(basename $(IDLS))) 


#-- libraries, programs, and drivers
        LIBRARIES = 
        PROGRAMS  =
        DRIVERS   =

#-- objects
        OBJECTS := \
                idlstream.o timestamp.o \
                $(addsuffix _c.o,$(basename $(IDLS))) \
                $(addsuffix _s.o,$(basename $(IDLS))) 

SECONDARY: $(GENERATED)

#-- (1st or primary) default goal
default::  touchit source libs programs drivers 

#-- some other worthy goals
all:      idl source objects libs programs drivers tmp
idl :     $(ICFS) $(IDLS) 
source:   $(GENERATED) 
objects:  $(OBJECTS)
libs:     $(LIBRARIES)
programs: $(PROGRAMS)
drivers:  $(DRIVERS)

touchit:
        touch AsrData.idl $(ICFS)

initial:
        touch $(GENERATED)

#-- include file dependencies
#$(GENERATED) $(OBJECTS) : $(MAKE_FILES)
$(OBJECTS): %.o: %.cpp %.h

#-- Handle the auto-checkout of ICF files, and making sure the IDL get's 
compiled
#-- if the ICF file changes
%.idl : %.icf
        @echo updating idl because of icf
        touch $@

#-- Generate source files from IDL 
#-- Set up a pattern to check to see if this idl has an associated ICF file
findicf=$(strip $(findstring $(basename $<).icf,$(ICFS)))

%_c.cpp %_c.h %_s.cpp %_s.h : %.idl
        @echo findicf = \"$(findicf)\"
#ifeq ("AsrDbServer.icf",$(strip $(findstring $(basename $<).icf,$(ICFS))))
ifeq ("",$(findicf))  # check if icf file exists
#ifeq '' "$(findicf)"  # check if icf file exists
        @echo making without icf file \"$(findstring $(basename $<).icf,$(ICFS))\"
        @echo making without icf file \"$(findicf)\"
else
        @echo making with icf file \"$(findstring $(basename $<).icf,$(ICFS))\"
        @echo making with icf file \"$(findicf)\"
endif
        touch $(basename $<)_c.cpp
        touch $(basename $<)_c.h
        touch $(basename $<)_s.cpp
        touch $(basename $<)_s.h
        touch $(basename $<)_c.o
        touch $(basename $<)_s.o

libBea.a : $(GENERATED)
        touch $@
    
#-- cleanup the directory
# note that makeRules already cleans
clean::
        rm -f core *.o $(PROGRAMS) $(LIBRARIES) $(GENERATED)

#-- clobber all targets
# note that makeRules already clobbers
clobber::

#-- install libraries
install_libs: source libs
        $(CP) $(LIBRARIES) $(LIB_DIR)/

#-- install programs (not)
install_programs: ; @echo "This rule left blank intentionally"

#-- install everything
install: install_libs

# eof #
# DO NOT DELETE THIS LINE -- make depend depends on it.

------------------------------------------------------------------------------
---------------------------
Makefile ends here
------------------------------------------------------------------------------
---------------------------


-- 
****   Please remove the NO.SPAM when replying   ****

Reply via email to