LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-10-2014, 09:46 AM   #1
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
make: get: Command not found


When running make with my source file checked out from SCCS, I get the above error. Could someone look at my makefile and give me an idea where the problem is? I copied this Makefile from some website and hacked at it to get what I wanted. Or is this a configuration problem?

file: Makefile
Code:
#IDIR =../include
IDIR=.
CC=gcc
CFLAGS=-I$(IDIR)

#ODIR=obj
ODIR=.
IDIR=.
LDIR=.
#LDIR =../lib

_DEPS = RAIM.h 
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))


_OBJ = testit.o GPIB.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))


$(ODIR)/%.o: %.c $(DEPS)
	$(CC) -c -o $@ $< $(CFLAGS)

testit: $(OBJ)
	gcc -o $@ $^ $(CFLAGS)

.PHONY: clean

clean:
	rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~
 
Old 09-10-2014, 11:13 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Where is any 'get' in this Makefile?
 
Old 09-10-2014, 11:19 AM   #3
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by NevemTeve View Post
Where is any 'get' in this Makefile?
Yeah, I don't see it either. I just don't understand why I get this error.
 
Old 09-10-2014, 11:23 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Try 'make -n' or even 'make -d'
 
Old 09-10-2014, 11:41 AM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
I ran "make -d" and got some confusing output. As you can see, it's drilling into the SCCS directory to see if I have the proper version to make.

Code:
Updating goal targets....
Considering target file `testit'.
  Considering target file `testit.o'.
   Looking for an implicit rule for `testit.o'.
   Trying pattern rule with stem `testit'.
   Trying implicit prerequisite `testit.c'.
   Trying rule prerequisite `RAIM.h'.
   Found an implicit rule for `testit.o'.
    Considering target file `testit.c'.
     Looking for an implicit rule for `testit.c'.
     Trying pattern rule with stem `testit'.
     Trying implicit prerequisite `testit.y'.
     Trying pattern rule with stem `testit'.
     Trying implicit prerequisite `testit.l'.
     Trying pattern rule with stem `testit'.
     Trying implicit prerequisite `testit.w'.
     Trying pattern rule with stem `testit'.
     Trying implicit prerequisite `testit.w'.
     Trying pattern rule with stem `testit.c'.
     Trying implicit prerequisite `testit.c,v'.
     Trying pattern rule with stem `testit.c'.
     Trying implicit prerequisite `RCS/testit.c,v'.
     Trying pattern rule with stem `testit.c'.
     Trying implicit prerequisite `RCS/testit.c'.
     Trying pattern rule with stem `testit.c'.
     Trying implicit prerequisite `s.testit.c'.
     Trying pattern rule with stem `testit.c'.
     Trying implicit prerequisite `SCCS/s.testit.c'.
     Found an implicit rule for `testit.c'.
      Considering target file `SCCS/s.testit.c'.
       Finished prerequisites of target file `SCCS/s.testit.c'.
      No need to remake target `SCCS/s.testit.c'.
     Finished prerequisites of target file `testit.c'.
     Prerequisite `SCCS/s.testit.c' is older than target `testit.c'.
    No need to remake target `testit.c'.
    Considering target file `RAIM.h'.
     Looking for an implicit rule for `RAIM.h'.
     Trying pattern rule with stem `RAIM.h'.
     Trying implicit prerequisite `RAIM.h,v'.
     Trying pattern rule with stem `RAIM.h'.
     Trying implicit prerequisite `RCS/RAIM.h,v'.
     Trying pattern rule with stem `RAIM.h'.
     Trying implicit prerequisite `RCS/RAIM.h'.
     Trying pattern rule with stem `RAIM.h'.
     Trying implicit prerequisite `s.RAIM.h'.
     Trying pattern rule with stem `RAIM.h'.
     Trying implicit prerequisite `SCCS/s.RAIM.h'.
     No implicit rule found for `RAIM.h'.
     Finished prerequisites of target file `RAIM.h'.
    No need to remake target `RAIM.h'.
   Finished prerequisites of target file `testit.o'.
   Prerequisite `testit.c' is older than target `testit.o'.
I wonder if the problem is related to "patsubst" in this line of the Makefile? I don't know anything about patsubst. Like I mentioned, I just copied this makefile from a tutorial and hacked it into submission. This only happens to me randomly. The next time it happens I'll try to take the time to run "make -d" and maybe remove the patsubst from the Makefile.

Code:
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
 
Old 09-10-2014, 08:57 PM   #6
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Raspbian, Ubuntu, Chrome/Crouton
Posts: 374

Rep: Reputation: 50
I believe the that the sccs get command is a builtin rule.

Make is calling get to check out a missing source file.

You can add the --no-builtin-rules make option to turn them all off.
 
Old 09-10-2014, 09:39 PM   #7
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by pwalden View Post
Make is calling get to check out a missing source file.
OK, that makes more sense. I've had some power outages lately, so I wonder if that's left something messed up as far as sccs is concerned? I usually just keep the source files checked out and checkpoint them to sccs as things change, so it's not likely that I've manually set permissions on a file that's not checked out.

Quote:
Originally Posted by pwalden View Post
You can add the --no-builtin-rules make option to turn them all off.
Where would I add that? I'm certainly not going to remember to type it every time.
 
Old 09-10-2014, 11:39 PM   #8
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by Quakeboy02 View Post
Quote:
Originally Posted by pwalden
You can add the --no-builtin-rules make option to turn them all off.
Where would I add that? I'm certainly not going to remember to type it every time.
If I understand correctly, adding
Code:
.SUFFIXES:
to your Makefile should be equivalent, see Suffix Rules.
 
Old 09-11-2014, 01:38 AM   #9
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
And if you haven't got a link, the manual is very informative
 
Old 09-11-2014, 10:56 AM   #10
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
Thanks everyone. The next time this happens I'll refer back to this thread to get it fixed.
 
Old 04-22-2015, 11:27 PM   #11
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
Sorry to resurrect this, but I ran into the problem again when trying to do a make immediately after doing an "sccs deledit". This thread was the first thing I found on a websearch. I tried adding ".SUFFIXES:" to the Makefile, but that didn't fix it. But, while editing the file in vi, I saved it without changing anything, and the error went away. So, I assume that touching it would have been good enough. It must be a date/timestamp issue.
 
Old 04-23-2015, 10:30 AM   #12
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by ntubski View Post
If I understand correctly, adding
Code:
.SUFFIXES:
to your Makefile should be equivalent, see Suffix Rules.
I rechecked the manual, which says
Quote:
Many of the predefined implicit rules are implemented in make as suffix rules
meaning not all are suffix rules, so perhaps .SUFFIXES doesn't affect the SCCS rule. Canceling Rules says to define a pattern rule without a recipe, so maybe
Code:
## Cancelling SCCS Rule: Any file n is extracted if necessary from an SCCS file named either s.n or SCCS/s.n
% : s.%
% : SCCS/s.%
If that doesn't work, as a last resort you could redefine GET to a nop:
Code:
# ":" means do nothing
GET := : NOT getting from SCCS

Last edited by ntubski; 04-23-2015 at 11:42 AM. Reason: supid typo; %s getting eaten?
 
Old 04-23-2015, 11:02 AM   #13
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
Hi ntubski,

The last one actually works, giving me the response below. Is there an obvious way to change it so that it touches the file in the current directory, not the file in the SCCS directory? Maybe it would help if I understood what's happening with your command. Since the ": NOT (etc)" is printed out, I take it that ":=" is equivalent to "assign this value". So, is it possible to use a sed command or something like that to get rid of "SCCS/" and change it to "touch " the file? Sorry, but this is just black magic to me.

Code:
: NOT getting from SCCS   SCCS/s.opt2.c
 
Old 04-23-2015, 11:53 AM   #14
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by Quakeboy02 View Post
The last one actually works,
I had a stupid typo in the first method, fix in red, see if it helps.

Quote:
Maybe it would help if I understood what's happening with your command. Since the ": NOT (etc)" is printed out, I take it that ":=" is equivalent to "assign this value". So, is it possible to use a sed command or something like that to get rid of "SCCS/" and change it to "touch " the file? Sorry, but this is just black magic to me.
Yeah, basically the SCCS rule uses executes $(GET) $(GFLAGS) SCCS/s.<the-file>, so by assigning the GET variable we can control what it does.
But manipulating the filename is awkward because we can only control the command before the filename.

Code:
# this might work?
GET := sh -c 'touch "$${0#SCCS/s.}"'
If you're just trying to hide the problem, putting a @ in front should work to tell make not echo the command before executing it:
Code:
GET := @: NOT getting from SCCS
 
1 members found this post helpful.
Old 04-23-2015, 12:00 PM   #15
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
Hmm, I guess I didn't notice the typo, either, but that one works. I only needed the one line. Thanks! And hopefully this thread will help the next guy - which will probably be me in a few months when I do some other project. =)

Added:
Code:
% : SCCS/s.%

Last edited by Quakeboy02; 04-23-2015 at 12:27 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
make: CC: Command not found make: *** [main.o] Error 127 on opensuse 11.3 Leo89 Linux - Newbie 6 11-30-2012 05:13 PM
NS-2.29 Make error (make: g++34: Command not found) avi2936 Linux - Newbie 8 09-17-2012 03:32 PM
make: command not found mantonr Linux - Newbie 7 08-27-2006 03:19 PM
make: command not found lel800 Linux - Newbie 9 01-27-2004 03:27 PM
make: cc: command not found make: *** [gzip.o]error 127 zyjk Linux - Newbie 5 02-08-2002 09:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration