Solved

Problem with "build product", make error

Posted on 1999-01-25
13
314 Views
Last Modified: 2013-12-26
A programmer left me a series of scripts to compile and package a series of programs into one executable.  The scripts do alot of "build product" or "build tools".  It all works fine on SCO OpenServer 5.0.4, but when I try and use the same scripts on Unixware 2.1.2, I get error messages.  When I tried it manually with build product, I get the message:

UX: make: Error. Must be a separator on rules line 4 (bu 39).

One person suggested that lines must have tabs rather than leading spaces, but that all seems to be fine.  There are a series of "Buildfiles" which contain sections like:

product:
   ( cd port; build product )
   ( cd ncurses; build product )

Some files have additional stuff, like actual cc commands, but I believe this is getting hung up the first time it tries to do a "build".  I am not a programmer, so I need some advice on what to look for.
0
Comment
Question by:douga99
13 Comments
 
LVL 3

Expert Comment

by:mliberi
ID: 1296386
> One person suggested that lines must have tabs rather than  leading spaces, but that all seems to be fine.

Not ALL the lines must be preceded by a TAB char, only lines containing commands. The rule lines MUST NOT be preceded by TAB.

I experienced that "make" command behaves differently on different platforms. Many times I had to modify a working "Makefile" to get it working on another OS.


0
 

Expert Comment

by:kenro
ID: 1296387
Make sure you aren't running GNU make on your SCO machine, but regular make on UNIXWARE.  In general, GNU make will run anything regular make does, but not vice-versa.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1296388
mliberi, how about that you give your TAB comment as answer ;-)
0
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

Author Comment

by:douga99
ID: 1296389
Just so everyone knows, the TAB comment above was not the answer.  It appears the file are structured appropriately with TABS where needed and with no TABS where not needed.  Thanks though.

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1296390
Could you please post the first 10 line of this makefile.
0
 

Author Comment

by:douga99
ID: 1296391
Here is the "offending" Buildfile (is it the same as a makefile?):

OPTIONS = -DHAVE_RENAME -DHAVE_STRDUP -DHAVE_STRERROR -DHAVE_PWENT -DHAVE_GRENT -DHAVE_STRSTR -DHAVE_TMPFILE -DHAVE_TELL -DHAVE_FTIME

.c.o:
      $(CC) -c $(CFLAGS) $(OPTIONS) $<

SRCS =       default.c ftime.c getdate.c getpath.c grp.c matchpat.c \
      mkname.c mktime.c name.c pwd.c rename.c resolve.c spname.c \
      stccat.c stccpy.c strany.c strdup.c strenv.c strerror.c \
      strftime.c stricmp.c strint.c stristr.c strlwr.c strnicmp.c \
      strpack.c strpad.c strstr.c strupr.c tell.c tilde.c tmpfile.c \
      vector.c xgets.c

OBJS =       default.o ftime.o getdate.o getpath.o grp.o matchpat.o \
      mkname.o mktime.o name.o pwd.o rename.o resolve.o spname.o \
      stccat.o stccpy.o strany.o strdup.o strenv.o strerror.o \
      strftime.o stricmp.o strint.o stristr.o strlwr.o strnicmp.o \
      strpack.o strpad.o strstr.o strupr.o tell.o tilde.o tmpfile.o \
      vector.o xgets.o

all: $(LIBRARY)

product: $(LIBRARY)
      install -d -m 644 -f$(LIBDIR) $(LIBRARY)

clean:
      rm -f $(LIBRARY) getdate.c *.o a.out core

$(LIBRARY): $(OBJS)
      @rm -f $(LIBRARY)
      ar cq $(LIBRARY) $(OBJS)
      $(RANLIB) $(LIBRARY)

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1296392
looks good (if there are the TABS in the right places).
Only the first macro definition (OPTIONS=) may be the problem if it is written in 2 lines, then you need to add a \ as very last character in the first line, like:

OPTIONS = -DHAVE_RENAME -DHAVE_STRDUP -DHAVE_STRERROR -DHAVE_PWENT \
-DHAVE_GRENT -DHAVE_STRSTR -DHAVE_TMPFILE -DHAVE_TELL -DHAVE_FTIME

(hope that E-E, did format it corrctly)
0
 

Author Comment

by:douga99
ID: 1296393
I didn't realize when I did the cut and paste, that the indents no longer show.  There is a tab beginning each line in the section following a colon. The OPTIONS= line appears to be written as one continuous line.  Don't forget that this works fine on SCO OSR5, but bombs in UnixWare.  Is there something wrong with my UnixWare?

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1296394
It's difficult to see if the Makefile is right.

> There is a tab beginning each line in the section following a colon.
Hope, this is *not* true for the targets which have no commands (like all: $(LIBRARY) ).
Also, the error message says "separator on rules line 4 (bu 39)"
This is either the OPTIONS= line, or the target $(LIBRARY): $(OBJS)

To me, it looks like you have not posted the complete Makefile, 'cause I cannot see the definition of LIBRARY.
If you don't know how Makefiles work, try to add following and test again, then post result:

LIBRARY=keep_make_happy
0
 

Author Comment

by:douga99
ID: 1296395
I added the line:
LIBRARY=keep_make_happy
to the Buildfile and a blank line after.  The error message changed to:

UX: make: Error. Must be a separator on rules line 6 (bu 39).

There are various Buildfiles in different directories.  It seems that whenever
I try to "build <something>" I get basically the same error message.

Thanks for your help.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1296396
With the added LIBRARY macro (see last 2 comments), try following command:

   make -f Buildfile all

You said you're using a "build script", could you please specify this. Probably post it. Or just post result of following:

    grep -i make build-script

then tell us which Makefile or Buildfile you have posted in your comment Sunday, March 07 1999 - 04:53PM PST.


0
 

Author Comment

by:douga99
ID: 1296397
I just reinstalled my UnixWare system.  Now I can process the files properly -- its runs the Buildfiles and compiles as it should.  Thanks alot for bearing with me all this time.  I'd be pleased to assign you the points... just tell me how to do it!

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 1296398
answer in the comments,
If you like to grade another person, you have to post a new (dummy) question.
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
UNiX Script filesystem space usage Part2 54 87
FizzBuzz challenge 9 80
OpenLDAP Proxy to Active Directy 6 284
Unix Command -- Challenging  question 7 90
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

770 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