• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

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
0
kjuliff
Asked:
kjuliff
  • 10
  • 6
  • 2
  • +1
1 Solution
 
pjedmondCommented:
------------------------------------------------------------------------------------------------------------
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"

?

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

(   (()
(`-' _\
 ''  ''
0
 
kjuliffAuthor Commented:
There's no error. It appears that it doesn't include the file.

It appears that TARGET is not being set.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
pjedmondCommented:
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.

(   (()
(`-' _\
 ''  ''
0
 
pjedmondCommented:
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?

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

echo $(TARGET)

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

(   (()
(`-' _\
 ''  ''
0
 
kjuliffAuthor Commented:
Nope!
0
 
kjuliffAuthor Commented:
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)
0
 
pjedmondCommented:
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.

(   (()
(`-' _\
 ''  ''
0
 
kjuliffAuthor Commented:
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

0
 
kjuliffAuthor Commented:
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

0
 
pjedmondCommented:
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.

(   (()
(`-' _\
 ''  ''
0
 
pjedmondCommented:
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;)   )
0
 
kjuliffAuthor Commented:
Now I get
UNIX.mak:8: *** missing separator.  Stop.
0
 
pjedmondCommented:
I presume that you are now trying the command:

make all?
----------8X-----------------------
all: $(BINDIR)
     $(MAKE) $(MAKEFLAGS) -f UNIX.mak server
----------8X-----------------------

That means that there is an error of some sort on line 8 of UNIX.mak

Thus means that we probably need to modify the make all rule to be:

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

From the debugging point of view to see what's going on.

I'm going to presume that you are getting the hang of how to 'debug' this now:) ? You have immediate access to the file to check what is going on a lot faster than using this thread now that you are understanding the fundamentals of how it all works. Obviously, if you've got any further Qs, then just post them.

(   (()
(`-' _\
 ''  ''
0
 
rindiCommented:
Could this be the error?

change

BINDIR = $(OS_NAME)-$(PLATFORM)

to

BINDIR = $(OS_NAME)_$(PLATFORM)
0
 
pjedmondCommented:
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?

(   (()
(`-' _\
 ''  ''
0
 
ahoffmannCommented:
replace

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

by

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 10
  • 6
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now