OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:57 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Meaty Skeleton - No rule to make target
PostPosted: Fri May 27, 2016 4:46 am 
Offline
Member
Member

Joined: Sat Dec 19, 2015 10:48 am
Posts: 42
I'm adding a GAS assembler file named kb1.S in Meaty Skeleton that gets keyboard input. There is already a GAS file in the build named boot.S and the only rule for that one is:
Code:
%.o: %.S
   $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)

When I run Make I get the message: No rule to make target (ARCHDIR)/kb1.o.
Why isn't the existing rule sufficient for the added GAS file kb1.S ? What can I do?

A variable in an included makefile (make.config) has the object files from both GAS files:
Code:
KERNEL_ARCH_OBJS:=\
$(ARCHDIR)/boot.o \
$(ARCHDIR)/tty.o \
(ARCHDIR)/kb1.o \


Top
 Profile  
 
 Post subject: Re: Meaty Skeleton - No rule to make target
PostPosted: Fri May 27, 2016 5:59 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
Have you looked carefully? What's the letter-by-letter difference between the boot.o line and the kb1.o line in your make.config?

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: Meaty Skeleton - No rule to make target
PostPosted: Fri May 27, 2016 12:44 pm 
Offline
Member
Member

Joined: Sat Dec 19, 2015 10:48 am
Posts: 42
Combuster wrote:
Have you looked carefully? What's the letter-by-letter difference between the boot.o line and the kb1.o line in your make.config?


Okay. Got it. Thanks. Bill S.


Top
 Profile  
 
 Post subject: Re: Meaty Skeleton - No rule to make target
PostPosted: Fri May 27, 2016 1:44 pm 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
Hi,


bilsch01 wrote:
There is already a GAS file in the build named boot.S and the only rule for that one is:
Code:
%.o: %.S
   $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
This seems suspiciously wrong. Are you really trying to assemble an assembly file with GCC?

Hint: $(CC) stands for C Compiler, what you want is $(AS).


Regards,
glauxosdever


Top
 Profile  
 
 Post subject: Re: Meaty Skeleton - No rule to make target
PostPosted: Fri May 27, 2016 2:41 pm 
Offline
Member
Member

Joined: Thu May 19, 2011 5:13 am
Posts: 228
glauxosdever wrote:
bilsch01 wrote:
There is already a GAS file in the build named boot.S and the only rule for that one is:
Code:
%.o: %.S
   $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)
This seems suspiciously wrong. Are you really trying to assemble an assembly file with GCC?
Hint: $(CC) stands for C Compiler, what you want is $(AS).
GCC will be more then happy to assemble the .S file to an object file (.o).
In fact it will first pass it to cpp the C preprocessor and then pass it along to AS.

PS. Bill has been keeping us entertained here and here.

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com


Top
 Profile  
 
 Post subject: Re: Meaty Skeleton - No rule to make target
PostPosted: Fri May 27, 2016 2:58 pm 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
Hi,


mikegonta wrote:
GCC will be more then happy to assemble the .S file to an object file (.o).
In fact it will first pass it to cpp the C preprocessor and then pass it along to AS.
I'm not sure it is a portable solution. You can't assume every C compiler will actually assemble assembly code.

mikegonta wrote:
PS. Bill has been keeping us entertained here and here.
I don't see the point of this statement.


Regards,
glauxosdever


Top
 Profile  
 
 Post subject: Re: Meaty Skeleton - No rule to make target
PostPosted: Tue May 31, 2016 3:31 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
glauxosdever wrote:
I'm not sure it is a portable solution. You can't assume every C compiler will actually assemble assembly code.


Err... can you assumbe that any two assemblers would actually assemble your source code?

Anyway, GNU make implicit rules actually use $(CC) to turn .s into object code if you link directly (i.e. omit the -c), so it's not as if using $(CC) for assembly is something the OP came up with... but yes, on the other hand GNU make uses $(AS) for implicitly turning .s to intermediate .o, so both of you have a point.

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: DotBot [Bot] and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group