Link to home
Start Free TrialLog in
Avatar of kjuliff
kjuliff

asked on

What is wrong with this segment of Makefile code?

The following segment of code is not working. BUT the target file is thjere (as indicated). In it OS_NAME and PLATFORM are defined. So what am I doing wrong?
-

------------------------------------------------------------------------------------------------------------
TARGET = /usr/informix/incl/dbdk/makeinc.linux86_64
include $(TARGET)
PROJECT_TITLE = vix_demo
BINDIR = $(OS_NAME)-$(PLATFORM)


Kate
Avatar of pjedmond
pjedmond
Flag of United Kingdom of Great Britain and Northern Ireland image

------------------------------------------------------------------------------------------------------------
TARGET = /usr/informix/incl/dbdk/makeinc.linux86_64
include $(TARGET)
PROJECT_TITLE = vix_demo
BINDIR = $(OS_NAME)-$(PLATFORM)

What is vix_demo set to?...or did you mean to put:

PROJECT_TITLE = "vix_demo"

?

(   (()
(`-' _\
 ''  ''
Any chance of being told what the given error is?

(   (()
(`-' _\
 ''  ''
Avatar of kjuliff
kjuliff

ASKER

There's no error. It appears that it doesn't include the file.

It appears that TARGET is not being set.
I'm presuming that there is not a binary file called vix_demo, so I'm going to stick with my original thoughts, however, if my assumption is wrong, it'd be nice to see the makefile as far as the lines you have already given.

(   (()
(`-' _\
 ''  ''
So if you change:

TARGET = /usr/informix/incl/dbdk/makeinc.linux86_64
include $(TARGET)

to:

include /usr/informix/incl/dbdk/makeinc.linux86_64

Does it work?

(   (()
(`-' _\
 ''  ''
or you could add a 'test lines' as required:

echo $(TARGET)

in order to give you confidence that the value has been set?

(   (()
(`-' _\
 ''  ''
Avatar of kjuliff

ASKER

Nope!
Avatar of kjuliff

ASKER

Here is the makefile and in a separate posing the include

# This Makefile builds the vix_demo DataBlade.

# TARGET must be set to the location/filename
# of the platform-specific make include file.
include  /usr/informix/incl/dbdk/makeinc.linux86_64

# ===============================================================

# This is the project title.
PROJECT_TITLE = vix_demo

BINDIR = $(OS_NAME)-$(PLATFORM)

# Platform independent code goes here.
# The following code was generated by BladeSmith.

MI_INCL = $(INFORMIXDIR)/incl
CFLAGS = -DMI_SERVBUILD $(CC_PIC) -I$(MI_INCL)/public -I$(MI_INCL)/esql -I$(MI_INCL) $(COPTS)
LINKFLAGS = $(SHLIBLFLAG) $(SYMFLAG)
LIBS =

PROJECT_OBJS= \
      $(BINDIR)/vix_am.$(OBJSUFF)      \
      $(BINDIR)/vix_blob_io.$(OBJSUFF)      \
      $(BINDIR)/vix_util.$(OBJSUFF)

PROJECT_LIBS=$(BINDIR)/$(PROJECT_TITLE).$(BLDLIB_SUFF)


all: $(BINDIR)
      $(MAKE) $(MAKEFLAGS) -f UNIX.mak server

# Construct the object file.

$(BINDIR)/vix_am.$(OBJSUFF) : vix_am.c
      $(CC) $(CFLAGS) -o $@ -c $?

$(BINDIR)/vix_blob_io.$(OBJSUFF) : vix_blob_io.c
      $(CC) $(CFLAGS) -o $@ -c $?

$(BINDIR)/vix_util.$(OBJSUFF) : vix_util.c
      $(CC) $(CFLAGS) -o $@ -c $?

udr.c :  $(PROJECT_TITLE).h

vix_blob_io.c :  $(PROJECT_TITLE).h

vix_util.c :  $(PROJECT_TITLE).h


# Construct the shared library.
# Do *NOT* link with client side libraries.
# You will see many undefined symbols during linking.  This is
# normal since those symbols are resolved when the server loads
# your shared object.
#
# ATTENTION:
# The ld "Symbol referencing errors" warning is normal.  
# These unresolved symbols are resolved when the server
# loads the shared object.  This list should be examined, however,
# for symbol names that may have been inadvertently misspelled.
# Misspelled symbol names will not be resolved here or at load time.
#
$(PROJECT_LIBS) : $(PROJECT_OBJS)
      $(SHLIBLOD) $(LINKFLAGS) -o $(PROJECT_LIBS) \
      $(PROJECT_OBJS) $(LIBS) $(DATABLADE_LIBS)


server:      $(PROJECT_LIBS)


clean:
      $(RM) $(RMFLAGS) $(PROJECT_LIBS) $(PROJECT_OBJS)


$(BINDIR):
      -mkdir $(BINDIR)
Try typing:

cat /usr/informix/incl/dbdk/makeinc.linux86_64

This will confirm that the file can be read. If not, then you need to look at the permissions for this file to ensure that it can be read by the make command.

(   (()
(`-' _\
 ''  ''
Avatar of kjuliff

ASKER

Here's the file named in TARGET

#**************************************************************************
#
#  Licensed Material - Property Of IBM
#
#  "Restricted Materials of IBM"
#
#  IBM Informix Dynamic Server
#  (c) Copyright IBM Corporation 1996, 2005 All rights reserved.
#
#      File            :      makeinc.linux86_64
#      Description      :      Make include file with Linux 64 bit EM64T
#                        series - rules and macros.
#                        OS and Version: Linux 2.4.21
#**************************************************************************

include ${INFORMIXDIR}/incl/dbdk/makeinc.gen

#----------------------------------------------------------------------
# Platform information
#----------------------------------------------------------------------
OS_NAME = linux
PLATFORM = linux86_64
OS_VER = echo
OS_ID_LETTER     =  F

#----------------------------------------------------------------------
# Name of compiler, linker etc.
#----------------------------------------------------------------------
SHLIBLOD         = gcc
RANLIB       = echo

#----------------------------------------------------------------------
# Library suffix
#----------------------------------------------------------------------
SHLIB_SUFF      =       so
SOSUFF            =      ${SHLIB_SUFF}

#----------------------------------------------------------------------
# Libraries to be linked in
#----------------------------------------------------------------------
PORT_LIBS      =      -ldl -lcrypt
LIB_NSL            =      
LIB_SOCKET      =      
LIB_MATH      =      -lm
LIB_SEC            =      
SYSLIB          =      ${LIB_NSL} ${LIB_SOCKET} ${PORT_LIBS} ${LIB_MATH}
#----------------------------------------------------------------------
# Compile and link flags
#----------------------------------------------------------------------
C_MC_FLAGS      =      -DLINUX -D_GNU_SOURCE -DIT_COMPILER_HAS_BOOL  -fsigned-char -m64
CXX_MC_FLAGS      =       $(C_MC_FLAGS)
PORT_CFLAGS      =      -DUNIX ${CXX_MC_FLAGS}
CCANSI            =      
CCSTRICTANSI      =      -ansi
CC_PIPE            =
CXX            =      g++ -fsigned-char -fPIC -m64
CC_PIC            =       -fPIC
EXCEP_HANDLE      =      

LD_DYN_FLAGS      =      -shared -m64
PORT_LDFLAGS    =       
CCLDFLAGS       =       -m64
SHLIBLFLAG      =       ${LD_DYN_FLAGS}

LD_STATIC_FLAGS =      -static -m64
LD_SHARED_FLAGS =      -shared -m64
CC_STATIC_FLAGS      =      -Wl,-Bstatic
CC_SHARED_FLAGS      =      -Wl,-Bdynamic

Avatar of kjuliff

ASKER

And here's my final comment for the moment as I'm about to tear my hair out -

it exits white "nothing to do for server" - as it obviously cannot resolve bindir

It looks as if it should work..but I know nothing! OK - Time to simplify things:)

Rename your old makefile to something, and create a new makefile:



-----------------8X------------------
# This Makefile builds the vix_demo DataBlade.

# TARGET must be set to the location/filename
# of the platform-specific make include file.
include  /usr/informix/incl/dbdk/makeinc.linux86_64

test:
        echo $(OS_NAME)
        echo $(PLATFORM)
-----------------8X------------------


now try:

make test

And it should correctly get the OS_NAME and platform.

If not, then I can only assume that there is a permissions problem with access to: /usr/informix/incl/dbdk/makeinc.linux86_64

You could try:

chmod 777 /usr/informix/incl/dbdk/makeinc.linux86_64

and see if it makes a difference? I'm also starting to clutch at straws here.

(   (()
(`-' _\
 ''  ''
Incidentally, you could add this 'test' rule to your current makefile if you wished, and use it for producing 'diagnostics' using the shell echo command.

You then just 'make test' to run this particular rule.

(   (()
(`-' _\
 ''  ''

P.S You're lucky....I haven't got much hair to pull out. I pulled most of it out a couple of years ago...(when I joined EE;)   )
Avatar of kjuliff

ASKER

Now I get
UNIX.mak:8: *** missing separator.  Stop.
ASKER CERTIFIED SOLUTION
Avatar of pjedmond
pjedmond
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rindi
Could this be the error?

change

BINDIR = $(OS_NAME)-$(PLATFORM)

to

BINDIR = $(OS_NAME)_$(PLATFORM)
No that is not the error - both are perfectly valid as directory names. I've also tested on my system to be on the 100% sure side;)

Your last error was:

UNIX.mak:8: *** missing separator.  Stop.

This doesn't have any connection to the BINDIR does it?

(   (()
(`-' _\
 ''  ''
replace

include ${INFORMIXDIR}/incl/dbdk/makeinc.gen

by

include $(INFORMIXDIR)/incl/dbdk/makeinc.gen
stiil believe in my suggestion http:#16976590 (beside probabaly other problems)