# make: Cannot find a rule to create target



## viniciov (Jun 28, 2007)

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)


----------



## lotuseclat79 (Sep 12, 2003)

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


----------



## viniciov (Jun 28, 2007)

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.


----------



## lotuseclat79 (Sep 12, 2003)

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


----------



## viniciov (Jun 28, 2007)

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


----------



## viniciov (Jun 28, 2007)

Sorry!!
The $MQ_LIBPATH is set to /oracle/mq


----------



## lotuseclat79 (Sep 12, 2003)

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


----------



## viniciov (Jun 28, 2007)

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.


----------



## lotuseclat79 (Sep 12, 2003)

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


----------

