LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-03-2013, 09:20 PM   #1
dy20082250
Member
 
Registered: Oct 2013
Location: China
Distribution: Fefora 9
Posts: 67

Rep: Reputation: Disabled
why my makefile have so many "conmand not found"


##################################################
# Makefile
##################################################

BOOT:=boot.asm
LDR:=loader.asm
KERNEL:=kernel.asm
BOOT_BIN:=$(subst .asm,.bin,$(BOOT))
LDR_BIN:=$(subst .asm,.bin,$(LDR))
KERNEL_BIN:=$(subst .asm,.bin,$(KERNEL))

IMG:=a.img
FLOPPY:=/mnt/floppy/

.PHONY : everything

everything : $(BOOT_BIN) $(LDR_BIN) $(KERNEL_BIN)
dd if=$(BOOT_BIN) of=$(IMG) bs=512 count=1 conv=notrunc
sudo mount -o loop $(IMG) $(FLOPPY)
sudo cp $(LDR_BIN) $(FLOPPY) -v
sudo cp $(KERNEL_BIN) $(FLOPPY) -v
sudo umount $(FLOPPY)

clean :
rm -f $(BOOT_BIN) $(LDR_BIN) $(KERNEL_BIN) *.o

$(BOOT_BIN) : $(BOOT)
nasm $< -o $@

$(LDR_BIN) : $(LDR)
nasm $< -o $@

$(KERNEL_BIN) : $(KERNEL)
nasm -f elf -o $(subst .asm,.o,$(KERNEL)) $<
ld -s -o $@ $(subst .asm,.o,$(KERNEL))
when i try to run it on my fedora9.0 there are so many "command not found" on my screen,but i can not see why .There
are no syntax errors .
i am a newbie and only did a little sctipts,please help me,thanks!
 
Old 11-03-2013, 09:39 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 11,667
Blog Entries: 12

Rep: Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894
Fedora 9 has been past end of life for over four years. That may or may not have anything to do with your errors, depending on what you are trying to install, but it is possible that whatever you are trying to install, if it is at all contemporary, is looking for libraries and the like that aren't in Fedora 9.

In addition, Fedora 9 no longer receives software or security updates.

In any event, it would be wise to use something more recent. If you want to stick with Fedora, the current release is Fedora 19.
 
Old 11-03-2013, 09:46 PM   #3
dy20082250
Member
 
Registered: Oct 2013
Location: China
Distribution: Fefora 9
Posts: 67

Original Poster
Rep: Reputation: Disabled
i know that you are right but this is not the cause

Quote:
Originally Posted by frankbell View Post
Fedora 9 has been past end of life for over four years. That may or may not have anything to do with your errors, depending on what you are trying to install, but it is possible that whatever you are trying to install, if it is at all contemporary, is looking for libraries and the like that aren't in Fedora 9.

In addition, Fedora 9 no longer receives software or security updates.

In any event, it would be wise to use something more recent. If you want to stick with Fedora, the current release is Fedora 19.
i know that you are right but this is not the cause,because i have runned the script on other distribution,the result is similar ,whatever ,thank you !
 
Old 11-03-2013, 10:18 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
If you really mean "conmand not found",
then please tell which "commands" it's about.

The text you show is not a Makefile.
To be so, a <TAB> must start lines 19-22, 25 28 31 34 35 ,
etc. backspace ( \ ) as shown :
Code:
##################################################
# Makefile
##################################################

BOOT:=boot.asm
LDR:=loader.asm
KERNEL:=kernel.asm
BOOT_BIN:=$(subst .asm,.bin,$(BOOT))
LDR_BIN:=$(subst .asm,.bin,$(LDR))
KERNEL_BIN:=$(subst .asm,.bin,$(KERNEL))

IMG:=a.img
FLOPPY:=/mnt/floppy/

.PHONY : everything

everything : $(BOOT_BIN) $(LDR_BIN) $(KERNEL_BIN)
dd if=$(BOOT_BIN) of=$(IMG) bs=512 count=1 conv=notrunc \
	sudo mount -o loop $(IMG) $(FLOPPY) \
	sudo cp $(LDR_BIN) $(FLOPPY) -v \
	sudo cp $(KERNEL_BIN) $(FLOPPY) -v \
	sudo umount $(FLOPPY)

clean :
	rm -f $(BOOT_BIN) $(LDR_BIN) $(KERNEL_BIN) *.o

$(BOOT_BIN) : $(BOOT)
	nasm $< -o $@

$(LDR_BIN) : $(LDR)
	nasm $< -o $@

$(KERNEL_BIN) : $(KERNEL)
	nasm -f elf -o $(subst .asm,.o,$(KERNEL)) $<
	ld -s -o $@ $(subst .asm,.o,$(KERNEL))
Then no errors : $ 'make' will create the files
boot.bin kernel.bin (+ kernel.o ) loader.bin

-

Last edited by knudfl; 11-03-2013 at 10:21 PM.
 
Old 11-03-2013, 10:34 PM   #5
dy20082250
Member
 
Registered: Oct 2013
Location: China
Distribution: Fefora 9
Posts: 67

Original Poster
Rep: Reputation: Disabled
reply

[QUOTE=knudfl;5057910]If you really mean "conmand not found",
then please tell which "commands" it's about.

The text you show is not a Makefile.
To be so, a <TAB> must start lines 19-22, 25 28 31 34 35 ,
etc. backspace ( \ ) as shown :
Code:
##################################################
# Makefile
##################################################

BOOT:=boot.asm
LDR:=loader.asm
KERNEL:=kernel.asm
BOOT_BIN:=$(subst .asm,.bin,$(BOOT))
LDR_BIN:=$(subst .asm,.bin,$(LDR))
KERNEL_BIN:=$(subst .asm,.bin,$(KERNEL))

IMG:=a.img
FLOPPY:=/mnt/floppy/

.PHONY : everything

everything : $(BOOT_BIN) $(LDR_BIN) $(KERNEL_BIN)
dd if=$(BOOT_BIN) of=$(IMG) bs=512 count=1 conv=notrunc \
	sudo mount -o loop $(IMG) $(FLOPPY) \
	sudo cp $(LDR_BIN) $(FLOPPY) -v \
	sudo cp $(KERNEL_BIN) $(FLOPPY) -v \
	sudo umount $(FLOPPY)

clean :
	rm -f $(BOOT_BIN) $(LDR_BIN) $(KERNEL_BIN) *.o

$(BOOT_BIN) : $(BOOT)
	nasm $< -o $@

$(LDR_BIN) : $(LDR)
	nasm $< -o $@

$(KERNEL_BIN) : $(KERNEL)
	nasm -f elf -o $(subst .asm,.o,$(KERNEL)) $<
	ld -s -o $@ $(subst .asm,.o,$(KERNEL))
Then no errors : $ 'make' will create the files
boot.bin kernel.bin (+ kernel.o ) loader.bin

-[/QUOTE】



I am sorry ,there are tabs in where you mention in my makefile because i copy and paste it on the Internet ,so it shows like this.when i run it almost every line has the result:command not found
just like this :./makefile:line 27:BOOT_BIN:command not found others are similar
 
Old 11-03-2013, 10:50 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
A makefile is input to the program make.

You don't run it like a shell script (well, unless you put a "#!make" as the first line)..
 
1 members found this post helpful.
Old 11-03-2013, 10:59 PM   #7
dy20082250
Member
 
Registered: Oct 2013
Location: China
Distribution: Fefora 9
Posts: 67

Original Poster
Rep: Reputation: Disabled
thank you very much

Quote:
Originally Posted by jpollard View Post
A makefile is input to the program make.

You don't run it like a shell script (well, unless you put a "#!make" as the first line)..
yes! you are right ! I make a very stupid error ,thanks again you save me !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
gigabyte U7300 "edit Makefile" command returns "error" drobin Linux - Newbie 8 09-04-2013 05:20 AM
Freewins Compiz plugin-- "no makefile found" adanedhel728 Ubuntu 4 03-31-2011 12:40 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
Makefile issue: "Makefile.src: File not found" m3rkury Linux - Software 1 02-22-2007 11:15 PM
"no targets specified and no makefile found" liljhand Linux - Software 9 01-01-2005 01:54 PM


All times are GMT -5. The time now is 02:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration