[omniORB] Problem merging makefiles

SatyaNarayana D. satya@lantana.tenet.res.in
Thu, 9 Sep 1999 23:25:14 +0530 (IST)


Hello everybody,	
	I have a huge s/w which uses basic socket-level prog. to implement
c/s. whose top-most level makefile (which in-turn invokes thousands of
files) is as follows:

FILE :Makefile
--------------
OBJS = $(SRCS:.cc=.o)
FILES=Makefile $(SRCS)
LOCAL_CLEAN = $(ETCDIR)/audsp $(ETCDIR)/.made

ETCDIR=$(TOP)/lib/etc/$(SYSTEM_TYPE)

ALL_EXECS = festival  festival_client

ALL = $(ALL_EXECS) make_audiosp

include $(TOP)/config/common_make_rules
include $(EST)/config/rules/bin_process.mak

ETCDIR=$(TOP)/lib/etc/$(SYSTEM_TYPE)

festival: festival_main.o $(LIBDEPS)
	$(LINK_COMMAND) -o festival festival_main.o $(LIBS)

festival_client: festival_client.o $(REQUIRED_LIBDEPS)
	$(LINK_COMMAND) -o festival_client festival_client.o $(LIBS)

$(ETCDIR)/audsp: $(ETCDIR)/.made audsp.o $(LIBDEPS)
	$(LINK_COMMAND) -o $(ETCDIR)/audsp audsp.o $(LIBS)

# Can't just rely on the dir as it gets updated with new files
# check for the data of a file created in etcdir

make_audiosp: $(ETCDIR)/audsp
	@$(DO_NOTHING)

$(ETCDIR)/.made:
	@ if [ ! -d $(ETCDIR) ] ; \
          then mkdir -p $(ETCDIR); fi
	@ if [ ! -f $(ETCDIR)/.made ] ; \
          then touch $(ETCDIR)/.made ; fi


Now ,I have rewritten both this client/server as CORBA c/s.. whose
top-level makefiles are as follows:

FILE:GNUmakefile
----------------
TOP1=$(HOME)/omniORB
CURRENT=../tts/festival/src/main
include $(TOP1)/config/config1.mk

FILE:dir.mk
-----------
CXXSRCS =  festival_c.cc \
          festival_impl.cc festival_clt.cc

DIR_CPPFLAGS = $(CORBA_CPPFLAGS)

CORBA_INTERFACES = Festival

festival_impl   = $(patsubst %,$(BinPattern),festival_impl)
festival_clt    = $(patsubst %,$(BinPattern),festival_clt)

ALL::   $(festival_impl) $(festival_clt)

CLEAN::
	$(RM)  $(festival_impl) $(festival_clt)

EXPORT::  $(festival_impl) $(festival_clt)
	@(module="tts"; $(ExportExecutable))

$(festival_impl): festival_impl.o $(CORBA_STUB_OBJS) $(CORBA_LIB_DEPEND)
	@(libs="$(CORBA_LIB)"; $(CXXExecutable))

$(festival_clt): festival_clt.o $(CORBA_STUB_OBJS) $(CORBA_LIB_DEPEND)
	@(libs="$(CORBA_LIB)"; $(CXXExecutable))


Now ,I have to merge both this files ,by replacing  the old socket-level
c/s reference in makefile by my new CORBA c/s refernces..
So I got..

FILE : (new)Makefile
--------------------
TOP=../..
DIRNAME=src/main

SRCS = audsp.cc 
OBJS = $(SRCS:.cc=.o)
FILES=Makefile $(SRCS)
LOCAL_CLEAN = $(ETCDIR)/audsp $(ETCDIR)/.made

ETCDIR=$(TOP)/lib/etc/$(SYSTEM_TYPE)

ALL = make_audiosp

include $(TOP)/config/common_make_rules
include $(EST)/config/rules/bin_process.mak

ETCDIR=$(TOP)/lib/etc/$(SYSTEM_TYPE)

#here I have added the GNUmakefile
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TOP1=$(HOME)/omniORB
CURRENT=../tts/festival/src/main
include $(TOP1)/config/config1.mk

$(ETCDIR)/audsp: $(ETCDIR)/.made audsp.o $(LIBDEPS)
	$(LINK_COMMAND) -o $(ETCDIR)/audsp audsp.o $(LIBS)

# Can't just rely on the dir as it gets updated with new files
# check for the data of a file created in etcdir

make_audiosp: $(ETCDIR)/audsp
	@$(DO_NOTHING)

$(ETCDIR)/.made:
	@ if [ ! -d $(ETCDIR) ] ; \
          then mkdir -p $(ETCDIR); fi
	@ if [ ! -f $(ETCDIR)/.made ] ; \
          then touch $(ETCDIR)/.made ; fi


After doing this ..When I tried to run 'make' I got the following error :

ERROR:
-----
/home/drongo/home1/corba/omniORB/mk/beforedir.mk:156: *** target file
`.PHONY' has both : and :: entries.  Stop.  

I feel u understood my problem . It is just to replace the old c/s with my
new CORBA c/s.. while retaining all the old header and library files to be
included..
 I feel the error is not in the file beforedi.mk 
beforedir.mk:156  line:- has nothing to do with PHONY targets..
 
I feel the error is only in the way I merge the files.. Can anybody solve
my problem..
	Suggestions/answers are greatly appreciated..
	Eagarly Waiting for the replies..
	It is very imp.. for me.. So please help me out..
	I will be very greatful to u..

Many Many thanks in advance..
Best soln.. will be given a cyberspace treat..
satya

      ------------------------------------------------------------------
	D.Satyanarayana | 122@Brahmaputra Hostel | IIT_M |Chennai-36|
		ph:(044)4459069 | satya@lantana.iitm.ernet.in
 A     *****************************************************************