Solved

What is wrong with this segment  of Makefile code?

Posted on 2006-06-22
20
309 Views
Last Modified: 2013-12-16
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
Comment
Question by:kjuliff
  • 10
  • 6
  • 2
  • +1
20 Comments
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
------------------------------------------------------------------------------------------------------------
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
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
Any chance of being told what the given error is?

(   (()
(`-' _\
 ''  ''
0
 
LVL 1

Author Comment

by:kjuliff
Comment Utility
There's no error. It appears that it doesn't include the file.

It appears that TARGET is not being set.
0
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
or you could add a 'test lines' as required:

echo $(TARGET)

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

(   (()
(`-' _\
 ''  ''
0
 
LVL 1

Author Comment

by:kjuliff
Comment Utility
Nope!
0
 
LVL 1

Author Comment

by:kjuliff
Comment Utility
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
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 1

Author Comment

by:kjuliff
Comment Utility
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
 
LVL 1

Author Comment

by:kjuliff
Comment Utility
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
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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
 
LVL 1

Author Comment

by:kjuliff
Comment Utility
Now I get
UNIX.mak:8: *** missing separator.  Stop.
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 250 total points
Comment Utility
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
 
LVL 87

Expert Comment

by:rindi
Comment Utility
Could this be the error?

change

BINDIR = $(OS_NAME)-$(PLATFORM)

to

BINDIR = $(OS_NAME)_$(PLATFORM)
0
 
LVL 22

Expert Comment

by:pjedmond
Comment Utility
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
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
replace

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

by

include $(INFORMIXDIR)/incl/dbdk/makeinc.gen
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
stiil believe in my suggestion http:#16976590 (beside probabaly other problems)
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now