1829115 Members
12701 Online
109986 Solutions
New Discussion

Problems with make

 
SOLVED
Go to solution
Tom Henning
Trusted Contributor

Problems with make

Hello all. I seem to be having a problme with make, but after trying everything I can think of I cannot find the problem.

We have recently had a co-worker leave us (past away, not just quit). We asre trying to pick up on his work and figure out his code (we are a small shop where the engineers generally write their own code). In looking at one program, we make a small change to the code, type make and make does not compile the solution. No error messages, just no results.

I cannot see any problems with the makefile, but something is going on. All of the files are stil owned by the original user, but group write permissions are on and we can write into the directory.

Makefile and sample compile attempt follow:

$ ll plotpdaps
-rwxrwxrwx 1 lc users 230048 Jul 16 2004 plotpdaps
$ make plotpdaps
cc pdaps_plot.o counts_to_eu.o read_head.o parse_pdaps_gms.o bcdtosec.o sectoirigstr.o draw_tics.o sig_fig.o getlocaltime.o irigstrtobcd.o getstring.o calctime.o totaltime.o conv_time_args.o decimate.o-o plotpdaps -I/usr/include/X11R5/X11 -I/opt/graphics/starbase/include -L/opt/graphics/common/lib -L/usr/lib/X11R5 -L/opt/graphics/starbase/lib -lXwindow -lXt -lX11 -lhpgfx -lXhp11 -lddCADplt -lm -ldld
$ ll plotpdaps
-rwxrwxrwx 1 lc users 230048 Jul 16 2004 plotpdaps
$ cat Makefile

# compile the pdaps_plot program
# For includes and libs necessary for starbase, see "Graphics
# Administration Guide HP-UX 10.x".

CCOPTS = -Ae -g -c -Dhp9000
LIBES = -L/opt/graphics/common/lib -L/usr/lib/X11R5 \
-L/opt/graphics/starbase/lib -lXwindow -lXt -lX11 -lhpgfx -lXhp11 \
-lddCADplt -lm -ldld
INCS = -I/usr/include/X11R5/X11 -I/opt/graphics/starbase/include
OBJECTS = pdaps_plot.o counts_to_eu.o read_head.o parse_pdaps_gms.o\
bcdtosec.o sectoirigstr.o draw_tics.o sig_fig.o getlocaltime.o\
irigstrtobcd.o getstring.o calctime.o totaltime.o conv_time_args.o\
decimate.o

plotpdaps : $(OBJECTS)
cc $(OBJECTS)-o plotpdaps $(INCS) $(LIBES)

printpdaps : $(OBJECTS)
cc -o printpdaps $(OBJECTS) $(INCS) $(LIBES)

pdaps_plot.o : pdaps_plot.c
cc $(CCOPTS) pdaps_plot.c

counts_to_eu.o : counts_to_eu.c
cc $(CCOPTS) counts_to_eu.c

read_head.o : read_head.c
cc $(CCOPTS) read_head.c

parse_pdaps_gms.o : parse_pdaps_gms.c
cc $(CCOPTS) parse_pdaps_gms.c

draw_tics.o : draw_tics.c
cc $(CCOPTS) draw_tics.c

bcdtosec.o : bcdtosec.c
cc $(CCOPTS) bcdtosec.c

sectoirigstr.o : sectoirigstr.c
cc $(CCOPTS) sectoirigstr.c

sig_fig.o : sig_fig.c
cc $(CCOPTS) sig_fig.c

getlocaltime.o : getlocaltime.c
cc $(CCOPTS) getlocaltime.c

irigstrtobcd.o : irigstrtobcd.c
cc $(CCOPTS) irigstrtobcd.c

getstring.o : getstring.c
cc $(CCOPTS) getstring.c

calctime.o : calctime.c
cc $(CCOPTS) calctime.c

totaltime.o : totaltime.c
cc $(CCOPTS) totaltime.c

conv_time_args.o : conv_time_args.c
cc $(CCOPTS) conv_time_args.c

decimate.o : decimate.c
cc $(CCOPTS) decimate.c

clean :
rm -f *.o
$


Any help would be nice.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?
14 REPLIES 14
Jean-Luc Oudart
Honored Contributor

Re: Problems with make

Hi have you tried to su - and run the make command. May be the user's environment affects the way this is run ?

Regards
Jean-Luc
fiat lux
TwoProc
Honored Contributor

Re: Problems with make

I see it -

you need a space after the "$(OBJECTS)" in the next line:
cc $(OBJECTS)-o plotpdaps $(INCS) $(LIBES)

should be:
cc $(OBJECTS) -o plotpdaps $(INCS) $(LIBES)

If you look in the output of the make command you can see:
decimate.o-o plotpdap
should have been:
decimate.o -o plotpdap
We are the people our parents warned us about --Jimmy Buffett
Tom Henning
Trusted Contributor

Re: Problems with make

John:

Good eyes, but that did produce an error message, once I did the suggested /bin/su - from a root shell (too lazy to change the old user's password right now). If you look at the original posting, no error message was produced at all while I was under my user ID. Once that *.o-o problem was corrected, the same thing happened.

I did do the suggested su - to the old user's name, and this time it worked without any problems. Begining to look like an environmental or permissions problme, so I'll keep looking in those directions.

Thanks for the help so far.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?
Elmar P. Kolkman
Honored Contributor

Re: Problems with make

Telling us the error message might help...
Also look for ACL's, for instance on the directory. Or if all objects are readable.
Every problem has at least one solution. Only some solutions are harder to find.
Jean-Luc Oudart
Honored Contributor

Re: Problems with make

Any alias for cc ?

Regards
Jean-Luc
fiat lux
A. Clay Stephenson
Acclaimed Contributor

Re: Problems with make

If you post thr errors you are seeing, it would make things much easier. Also because HTML eats whitespace, it's especially difficult to know if there is a syntax error. Unlike almost all other UNIX utilities, make is especially sensitive to the placement of .

Check all of your dependency rules for this exact syntax:

plotpdaps : $(OBJECTS)
cc $(OBJECTS) -o plotpdaps $(INCS) $(LIBES)
next step
next step




If it ain't broke, I can fix that.
Tom Henning
Trusted Contributor

Re: Problems with make

I posted the exact results from my login running the make command. No errors provided, no output past what I posted, and not even the "normal" warning about this not runnng on a 1.1 processor. It is acting like make is simply echo'ing the command out to the terminal and not executing it. I am sorry, should have made this point more carefully in my first post.

The cc command is not aliased on the working login or the departed user's login. The two logins have simular paths through the top 15 directories (with one minor exception on mine, referencing an elm directory first).


The makefile has a as specified above.

One interesting thing I did notice, is that when I tried the make as me and the typo above "decimate.o-o" was in the makefile, I received no error about this (as in the original post). But when I tried the su as suggested by Jean-Luc, the make failed with an error message about this exact point. I fixed the typo (introduced in my trouble shoot attempts accidently), as the departed user the make command worked.

Interesting.

Oops, should have said. This is a 11.11 box, with C/ANSI C and developer's toolkit installed. This is also happening on a 10.20 box (with C/ANSI C installed). This is about the last thing to get switched before we switch to 11.11 completely.

Any other suggestions? Or information requests.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?
A. Clay Stephenson
Acclaimed Contributor

Re: Problems with make

I'm beginning to think that you really have no problem other than confused datestamps. I suggest that you do a rm *.o and then make. At the very least, you should then see it make some of the objects and stop where the problem is.
If it ain't broke, I can fix that.
Tom Henning
Trusted Contributor

Re: Problems with make

OKay. Let me try to more fully explain the problem. When I log in as myself, in the proper directory, I get the following results (directly cut and pasted into this message, nothing left out):

--------------------------------------------
$ touch pdaps_plot.c ; ll pdaps_plot.c plotpdaps
-rw-rw-r-- 1 lc users 40281 Mar 2 12:07 pdaps_plot.c
-rwxrwxrwx 1 lc users 184944 Mar 2 08:37 plotpdaps
$ make plotpdaps
cc -Ae -g -c -Dhp9000 pdaps_plot.c
cc pdaps_plot.o counts_to_eu.o read_head.o parse_pdaps_gms.o bcdtosec.o sectoirigstr.o draw_tics.o sig_fig.o getlocaltime.o irigstrtobcd.o getstring.o calctime.o totaltime.o conv_time_args.o decimate.o -o plotpdaps -I/usr/include/X11R5/X11 -I/opt/graphics/starbase/include -L/opt/graphics/common/lib -L/usr/lib/X11R5 -L/opt/graphics/starbase/lib -lXwindow -lXt -lX11 -lhpgfx -lXhp11 -lddCADplt -lm -ldld
$ ll pdaps_plot.c plotpdaps
-rw-rw-r-- 1 lc users 40281 Mar 2 12:07 pdaps_plot.c
-rwxrwxrwx 1 lc users 184944 Mar 2 08:37 plotpdaps
$
--------------------------------------------
As can be seen from this snippett, the date stamps on the single source file touched are later than the resultant program file both before and after the make command is issued.

Now, I do a:
$ sudo /bin/sh - lc #lc is the departed user's ID.
$ id
uid=106(lc) gid=104(wavies) groups=102(mysql)
$

Notice that this user is not even in the same group as the files are, but he is the owner of the files and directories.

Repeating the above test commands:

--------------------------------------------
$ touch pdaps_plot.c ; ll pdaps_plot.c plotpdaps
-rw-rw-r-- 1 lc users 40281 Mar 2 12:13 pdaps_plot.c
-rwxrwxrwx 1 lc users 184944 Mar 2 08:37 plotpdaps
$ make
cc -Ae -g -c -Dhp9000 pdaps_plot.c
cc pdaps_plot.o counts_to_eu.o read_head.o parse_pdaps_gms.o bcdtosec.o sectoirigstr.o draw_tics.o sig_fig.o getlocaltime.o irigstrtobcd.o getstring.o calctime.o totaltime.o conv_time_args.o decimate.o -o plotpdaps -I/usr/include/X11R5/X11 -I/opt/graphics/starbase/include -L/opt/graphics/common/lib -L/usr/lib/X11R5 -L/opt/graphics/starbase/lib -lXwindow -lXt -lX11 -lhpgfx -lXhp11 -lddCADplt -lm -ldld
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (pdaps_plot.o) was detected. The linked output may not run on a PA 1.x system.
$ ll pdaps_plot.c plotpdaps
-rw-rw-r-- 1 lc users 40281 Mar 2 12:13 pdaps_plot.c
-rwxrwxrwx 1 lc users 184944 Mar 2 12:13 plotpdaps
$
---------------------------------------------
In this second test run, as the owner of the files, you can see that the make does what it is supposed to do, and even optputs the "normal" PA 1.x warning message that is not see in the first run under my normal user ID. This is what is making me crazy. My normal ID has permissions (the directory is:

$ ll -d .
drwxrwxr-x 3 lc users 2048 Mar 2 12:13 .
$

My normal ID is a member of the users group.

Do not think it matters, but the lc user ID is now locked out from normal login . Only root can su to him now.

Back to rereading the man page for make again.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?
A. Clay Stephenson
Acclaimed Contributor

Re: Problems with make

This is behaving like the sticky bit is set on the directory although ll doesn't indicate it. It's also possible that ACL's are in play. Assuming this directory is in a vxfs filesystem, do a getacl on this directory.
If it ain't broke, I can fix that.
Tom Henning
Trusted Contributor

Re: Problems with make

Not a problem, also not the answer (I think).

$ ll -d .
drwxrwxrwx 3 lc users 2048 Mar 2 12:47 .
$ getacl .
# file: .
# owner: lc
# group: users
user::rwx
group::rwx
class:rwx
other:rwx
$


After posting the last message above, I did change the directory permissions from 775 to 777, with no change is results.

Also overlooked above, is that the plot_pdaps.o file does get updated. After a make clean, all of the object files (*.o) do get updated, it's just the final cc to generate the executable that does not run.

I do wish to say thanks for the help so far. At least it does not seem to be something simple I was just overlooking.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?
Jean-Luc Oudart
Honored Contributor
Solution

Re: Problems with make

Any results when you compare environment variables : CCOPTS LDOPTS ,...

Regards
Jean-Luc
fiat lux
Tom Henning
Trusted Contributor

Re: Problems with make

BINGO!!

I checked the environmental variables between the two accounts. One the one that was not working, CCOPTS was equal to '-Aa -g +DAportable', on the working account the CCOPTS variable was not set. I unset the CCOPTS variable on the non-working account, and the make started working as expected.

I do not understand this. If anyone can explain, I would love to hear it, but at least we have a workaround for the problem.

Thanks all, and I will be assigning points shortly.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?
Tom Henning
Trusted Contributor

Re: Problems with make

Okay, I am a novice to the forms yet, so I did not close this thread in the above posting, which does contain the solution to the problem. Si I am closing it here.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?