Solved

Problem with "build product", make error

Posted on 1999-01-25
13
307 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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…
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…

758 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

17 Experts available now in Live!

Get 1:1 Help Now