1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

make: Cannot find a rule to create target

Discussion in 'Software Development' started by viniciov, Jun 28, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. viniciov

    viniciov Thread Starter

    Joined:
    Jun 28, 2007
    Messages:
    5
    I have an script that does this:

    make -f ./9i_mqseries.mk extproc_nocallback NM=nm LD="/bin/ld" LIBDIR=lib32 SHARED_LIBNAME=$MQ_LIBPATH/mqseries.so OBJS="/usr/mqm/lib/libmqm.a"
    make -f ./9i_mqseries.mk extproc_nocallback NM=nm LD="/bin/ld" LIBDIR=lib32 SHARED_LIBNAME=$MQ_LIBPATH/mqi.so OBJS="mqi.o"
    make -f ./9i_mqseries.mk extproc_callback NM=nm LD="/bin/ld" LIBDIR=lib32 SHARED_LIBNAME=$MQ_LIBPATH/mqixa.so OBJS=mqixa.o


    but returns with this error:

    Making shared libraries...

    make: Cannot find a rule to create target /usr/mqm/lib/libmqm.a from dependencies.
    Stop.
    make: Cannot find a rule to create target /oracle/mq/mqi.o from dependencies.
    Stop.
    make: Cannot find a rule to create target /oracle/mq/mqixa.o from dependencies.
    Stop.
    Define MQSeries package


    Im using AIX 5.3
    I suspict that the makefile is wrong but I have no expertise on this field. ANy help will be appretiated.

    Here is the makefile:

    #
    # For linking in 32 bit mode set the following:
    # NM=nm LD=/bin/ld LIBDIR=lib32
    #
    # For linking in 64 bit mode set the following:
    # NM="nm -X64" LD="/bin/ld -b64" LIBDIR=lib
    #
    # $(NM), $(LD), and $(LIBDIR) were added to BUILDLIB_NO_CONTEXT and
    # BUILD_WITH_CONTEXT as the values were hardcoded for 64 bit only
    #

    include $(ORACLE_HOME)/rdbms/lib/env_rdbms.mk
    include $(ORACLE_HOME)/rdbms/demo/demo_rdbms.mk

    BUILDLIB_NO_CONTEXT=generate_export_list() \
    { \
    $(NM) -B -h -g "$$1" | grep -v ' U ' | awk '{print $$3}' | \
    egrep -v '^\.|^TOC' | sort | uniq ; \
    }; \
    generate_import_list() { \
    LIB_NAME=$$1; \
    IMP_FILE=$$2; \
    \
    cat ${KSMSIMP} | head -1 | awk '{print $$0, "." }' > $${IMP_FILE}; \
    $(NM) -C -B -h -g $${LIB_NAME} | grep ' U ' | grep -v "::" | grep -v "(" | grep -v "\.cc" | awk '{print $$3}' | sed -e "s/\.//g" | grep -v "^_" >> $${IMP_FILE}; \
    }; \
    \
    generate_import_list $(OBJS) $(SHARED_LIBNAME).imp; \
    generate_export_list $(OBJS) > $(SHARED_LIBNAME).exp; \
    $(LD) -bnoentry -bM:SRE -bE:$(SHARED_LIBNAME).exp -bI:$(SHARED_LIBNAME).imp \
    -o $(SHARED_LIBNAME) $(OBJS) -L$(ORACLE_HOME)/$(LIBDIR) -lc_r

    BUILDLIB_WITH_CONTEXT=generate_export_list() \
    { \
    $(NM) -B -h -g "$$1" | grep -v ' U ' | awk '{print $$3}' | \
    egrep -v '^\.|^TOC' | sort | uniq ; \
    }; \
    generate_import_list() { \
    LIB_NAME=$$1; \
    IMP_FILE=$$2; \
    \
    cat ${KSMSIMP} | head -1 | awk '{print $$0, "." }' > $${IMP_FILE}; \
    $(NM) -C -B -h -g $${LIB_NAME} | grep ' U ' | grep -v "::" | grep -v "(" | grep -v "\.cc" | awk '{print $$3}' | sed -e "s/\.//g" | grep -v "^_" >> $${IMP_FILE}; \
    }; \
    \
    generate_import_list $(OBJS) $(SHARED_LIBNAME).imp; \
    generate_export_list $(OBJS) > $(SHARED_LIBNAME).exp; \
    $(LD) -bnoentry -bM:SRE -bE:$(SHARED_LIBNAME).exp -bI:$(SHARED_LIBNAME).imp \
    -o $(SHARED_LIBNAME) $(OBJS) -L$(ORACLE_HOME)/$(LIBDIR) -lc_r $(LLIBCLNTSH)
     
  2. lotuseclat79

    lotuseclat79

    Joined:
    Sep 12, 2003
    Messages:
    20,583
    Hi viniciov,

    Welcome to TSG!

    What is the command you used to invoke the makefile?

    The makefile does not contain a target to build: libmqm.a, mui.o, and mqixa.o

    This means you need to have the sources for mui.o and mqixa.o which are presumably source code objects compiled from sources: mui.c and mqixa.c (assuming they are written in the C language) that are components of the library,libmqm.a, and you need to have rules to compile them and create the library libmqm.a from them in the makefile, so that the makefile can then create the shared libraries: mqseries.so, mqi.so, and mqixa.so.

    Example rules:
    mui.o: mui.c
    mquxa.o: mquxa.c
    libmqm.a: mquxa.o mui.o

    Look for the source files which may be in some other directories. If you find them elsewhere, you will need to add the pathname to those directories (aka folders in Windows speak) to the appropriate variable in the makefile.

    -- Tom
     
  3. viniciov

    viniciov Thread Starter

    Joined:
    Jun 28, 2007
    Messages:
    5
    The script I used to invoke the makefile look like this:

    echo "Compiling C subroutines..."
    cc mqi.c -c -o mqi.o -q32 -I $MQINC
    cc mqixa.c -c -o mqixa.o -q32 -I $MQINC

    echo " "
    echo "Making shared libraries..."
    echo " "
    rm -f $MQ_LIBPATH/mqi.so*
    rm -f $MQ_LIBPATH/mqixa.so*
    rm -f $MQ_LIBPATH/mqseries.so*
    make -f ./9i_mqseries.mk extproc_nocallback NM=nm LD="/bin/ld" LIBDIR=lib32 SHARED_LIBNAME=$MQ_LIBPATH/mqseries.so OBJS="/usr/mqm/lib/libmqm.a"
    make -f ./9i_mqseries.mk extproc_nocallback NM=nm LD="/bin/ld" LIBDIR=lib32 SHARED_LIBNAME=$MQ_LIBPATH/mqi.so OBJS="mqi.o"
    make -f ./9i_mqseries.mk extproc_callback NM=nm LD="/bin/ld" LIBDIR=lib32 SHARED_LIBNAME=$MQ_LIBPATH/mqixa.so OBJS=mqixa.o


    The portion highligted in green is the compilation of C subroutines. This portion works well with no errors. The portion in red is the one who actually invokes the makefile command and throws the error.

    Do you mean that the syntax of makefile script is wrong?

    Here is a listing of all the files in the directory I'm invoking the makefile:

    9i_mqinstall.sh
    9i_mqseries.mk
    ccmqi
    ccmqixa
    license4.txt
    ma0i.zip
    makeit
    mm-license
    mqget.sql
    mqi.c
    mqims.sql
    mqinstall.sh
    mqinstall.sql
    mqixa.pc
    mqpack.sql
    mqput.sql
    mqput1.sql
    mqsamp1.sql
    mqsamp2.sql
    mqsamp_setup.sql
    mqsec.sql
    MQSERIES.con
    MQSERIES.def
    readme


    Thanks a lot for your help.
     
  4. lotuseclat79

    lotuseclat79

    Joined:
    Sep 12, 2003
    Messages:
    20,583
    What is the full pathname for your source directory?

    What is the full pathname for $MQ_LIBPATH?

    Try running your script with "make -d -f ..." and it will list debugging output you can repost back here.

    What does the readme file say?

    -- Tom
     
  5. viniciov

    viniciov Thread Starter

    Joined:
    Jun 28, 2007
    Messages:
    5
    What is the full pathname for your source directory?
    /oracle/mq/ma0i

    What is the full pathname for $MQ_LIBPATH?
    MQINC=/usr/mqm/inc

    Try running your script with "make -d -f ..." and it will list debugging output you can repost back here.
    I'll give you feedback soon because I have no remote access to this server.

    What does the readme file say?
    It is attached
     

    Attached Files:

  6. viniciov

    viniciov Thread Starter

    Joined:
    Jun 28, 2007
    Messages:
    5
    Sorry!!
    The $MQ_LIBPATH is set to /oracle/mq
     
  7. lotuseclat79

    lotuseclat79

    Joined:
    Sep 12, 2003
    Messages:
    20,583
    Hi viniciov,

    The readme file says that "makeit" is the script to make the shared libraries. Are you using it? Also, the readme file says that you need to be an Oracle user with permissions - are you and do you?

    -- Tom
     
  8. viniciov

    viniciov Thread Starter

    Joined:
    Jun 28, 2007
    Messages:
    5
    This is the contents of the makeit file

    MQ_LIBPATH=/tmp/mq
    rm -f mqi.so*
    rm -f mqixa.so*
    rm -f mqseries.so*
    make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_nocallback SHARED_LIBNAME=$MQ_LIBPATH/mqseries.so OBJS="/usr/mqm/lib/libmqm.a"
    make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_nocallback SHARED_LIBNAME=
    $MQ_LIBPATH/mqi.so OBJS="mqi.o"
    make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_callback SHARED_LIBNAME=$M
    Q_LIBPATH/mqixa.so OBJS=mqixa.o


    I tried to run it manually before the script I have been using and get the same errors:

    babdbi01/oracle/mq/ma0i>./makeit

    make: Cannot find a rule to create target /usr/mqm/lib/libmqm.a from dependencies.
    Stop.
    generate_export_list() { /bin/nm -X32_64 -B -h -g "$1" | grep -v ' U ' | awk '{print $3}' | egrep -v '^\.|^TOC' | sort | uniq ; }; generate_import_list() { LIB_NAME=$1; IMP_FILE=$2; cat /oracle/product/10.2.0.1.0/rdbms/lib/xa.imp | head -1 | awk '{print $0, "." }' > ${IMP_FILE}; /bin/nm -X32_64 -C -B -h -g ${LIB_NAME} | grep ' U ' | grep -v "::" | grep -v "(" | grep -v "\.cc" | awk '{print $3}' | sed -e "s/\.//g" | grep -v "^_" >> ${IMP_FILE}; }; generate_import_list mqi.o /oracle/mq/mqi.so.imp; generate_export_list mqi.o > /oracle/mq/mqi.so.exp; /bin/ld -b64 -bnoentry -bM:SRE -bE:/oracle/mq/mqi.so.exp -bI:/oracle/mq/mqi.so.imp -o /oracle/mq/mqi.so mqi.o -L/oracle/product/10.2.0.1.0/lib -lc_r -lm

    ld: 0711-738 ERROR: Input file mqi.o:
    XCOFF32 object files are not allowed in 64-bit mode.
    make: The error code from the last command is 8.


    Stop.
    /oracle/product/10.2.0.1.0/bin/oraxlc -O3 -q64 -DSS_64BIT_SERVER -qwarn64 -qinfo=uni -DAIXRIOS -qtocmerge -bimport:/oracle/product/10.2.0.1.0/lib/ksms.imp -I/oracle/product/10.2.0.1.0/rdbms/demo -I/oracle/product/10.2.0.1.0/rdbms/public -I/oracle/product/10.2.0.1.0/plsql/public -I/oracle/product/10.2.0.1.0/network/public -c -I/oracle/product/10.2.0.1.0/rdbms/demo -I/oracle/product/10.2.0.1.0/rdbms/public -I/oracle/product/10.2.0.1.0/plsql/public -I/oracle/product/10.2.0.1.0/network/public -I/oracle/product/10.2.0.1.0/precomp/public mqixa.c

    /oracle/product/10.2.0.1.0/bin/oraxlc[171]: /usr/vac/bin/xlc: not found
    make: The error code from the last command is 127.


    Stop.
     
  9. lotuseclat79

    lotuseclat79

    Joined:
    Sep 12, 2003
    Messages:
    20,583
    Your latest post indicates that you are issuing the make for the 64 bit version of output - is that what you want?

    Also, look at post #2 for the example rules that may be missing in the makefile. If you do not see them in the makefile, then insert them by editing the makefile.

    Otherwise, if you really wanted the 32 bit version of output, read the documantation to understand how to invoke the scripts to get 32 bit output compilation of source code and libraries.

    -- Tom
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/589412

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice