Solved

What is wrong with this segment  of Makefile code?

Posted on 2006-06-22
20
313 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
ID: 16963787
------------------------------------------------------------------------------------------------------------
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
ID: 16963820
Any chance of being told what the given error is?

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

Author Comment

by:kjuliff
ID: 16963856
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
ID: 16963897
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
ID: 16963918
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
ID: 16964040
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
ID: 16964056
Nope!
0
 
LVL 1

Author Comment

by:kjuliff
ID: 16964081
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
ID: 16964088
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 1

Author Comment

by:kjuliff
ID: 16964089
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
ID: 16964099
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
ID: 16964365
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
ID: 16964463
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
ID: 16969408
Now I get
UNIX.mak:8: *** missing separator.  Stop.
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 250 total points
ID: 16970116
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 88

Expert Comment

by:rindi
ID: 16971891
Could this be the error?

change

BINDIR = $(OS_NAME)-$(PLATFORM)

to

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

Expert Comment

by:pjedmond
ID: 16973082
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
ID: 16976590
replace

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

by

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

Expert Comment

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

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
LDAP find expired users 8 73
nagios 1 22
Linux/Apache File Ownership/Permissions 1 53
Penetration Testing home based work 3 54
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

920 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

15 Experts available now in Live!

Get 1:1 Help Now