gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > make command not working in command prompt

#104725 - sasuke_kun12 - Mon Oct 02, 2006 12:26 am

yeah this is really bugging me. I really want to compile my program but when i type "make" in the directory of the makefile it just won't work! can anyone help me?
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#104726 - TJ - Mon Oct 02, 2006 12:47 am

This is on Windows, I assume? What exactly happens?

#104731 - sasuke_kun12 - Mon Oct 02, 2006 1:59 am

it just says 'make' is not recognised as blah blah blah

thanks for helpin me out! i really appreciate it!
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#104734 - shadowghost21 - Mon Oct 02, 2006 3:04 am

you need to set in the the enviroment variables, If you dont know how to do that get the devkitpro installer and use that. Start by uninstalling your previous version of devkit and use the installer it will do everything for you. If you dont want to uninstall/reinstall go to their web site and read the setup part on their page.
-shadowghost21

#104735 - sasuke_kun12 - Mon Oct 02, 2006 5:29 am

i've checked and double checked

is there another way? e.g. use visual c++?
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#104736 - DekuTree64 - Mon Oct 02, 2006 5:55 am

For windows XP, if you don't want to reinstall devkitpro:

Go to control panel, system, advanced tab, click on the 'environment variables', find the variable 'Path' in system variables, click edit. Add the path to your msys\bin folder (for me, c:\devkitpro\msys\bin) at the end or wherever.

Really though, reinstalling DKP doesn't take that long, and would make sure you have everything up to date anyway.

EDIT: For VC++, what I do is create a new "makefile" project (it's one of the options in the new project window), and set the build command line to

c:\devkitpro\msys\bin\make

Which is just like typing the same thing from a command prompt with the working folder set to your project's root. So provided that you have a makefile named Makefile there, it will use that. Otherwise you can add -f whatever.mk to give it a specific makefile.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#104752 - sasuke_kun12 - Mon Oct 02, 2006 11:24 am

ok i use msys to compile stuff but when i do it comes up with errors
e.g.

/c/rottds/makefile

/c/rottds/makefile suffixes: command not found
/c/rottds/makefile line 6: syntax error near unexpected token '$(devkitarm)),)'
/c/rottds/makefile line 6 'if eq ($(strip$(devkitarm)),);

wtf? do i have to reinstall devkitpro?
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#104760 - Cearn - Mon Oct 02, 2006 12:50 pm

sasuke_kun12 wrote:
ok i use msys to compile stuff but when i do it comes up with errors
e.g.

/c/rottds/makefile

/c/rottds/makefile suffixes: command not found
/c/rottds/makefile line 6: syntax error near unexpected token '$(devkitarm)),)'
/c/rottds/makefile line 6 'if eq ($(strip$(devkitarm)),);

wtf? do i have to reinstall devkitpro?
No, the installation is probably fine.
The problem is that by entering 'makefile', msys will interpret it as a shell script, which it isn't. Just 'make' will do.

#104803 - tepples - Mon Oct 02, 2006 8:44 pm

Cearn wrote:
The problem is that by entering 'makefile', msys will interpret it as a shell script, which it isn't. Just 'make' will do.

That, or put the following as the first line of your makefile, so that MSYS knows to use Make to interpret it:
Code:
#!/usr/bin/make -f

Would that work?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#104823 - sasuke_kun12 - Mon Oct 02, 2006 10:45 pm

alrite i got make rite in command prompt i'm now using my bros pc to compile but i get this

Code:

make[2]: /c/triad/build/Makefile: No such file or directory
make[2]: *** No rule to make target `/c/triad/build/Makefile'.  Stop.
make[1]: *** [build] Error 2
make: *** [build] Error 2


is it my makefile? coz i've tried compiling something i haven't made myself and i get the same thing
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#104833 - gmiller - Tue Oct 03, 2006 12:47 am

You should not type "Makefile", that is the defalt input file that the "make" utility reads to figure out what need to be done. From the msys comand prompt you should change to the directory that contains your Makefile. So in your case, based on your example:
Code:

cd /c/triad/build


Once there you need to have the make file utility read and do the required work that your make file describes. To see what it would do without actually doing it do the following:
Code:

make -n


This will display the commands needed to be done based on the dependencies of your "Makefile". If you want those commands done just do the following:
Code:

make


Of course in all of this I am assuming your "Makefile" is correct. It is fairly easy to produce a "Makefile" that "looks" right but is incorrect in it's syntax. Any line that is supposed to be a command from the previous line must begin with a tab character not a space. If it begins with a space then that line will not be executed as a continuation of commands from the prior line and in general will never be executed. For example:

Fictious snippet of a Makefile
Code:

I = ../inc/

common  = link_list.o log.o tiff_util.o fields.o file_d_rtn.o mime.o

dialogic  = gc_api.o srdev_layer.o

s_cygwin = getaddrinfo.o inet_pton.o

linux = $(common) $(dialogic)

cygwin = $(common)

all = $(linux)

base : lib $(all) iosr-tcp.o iolsr-tcp.o iosr-async.o depends.d

ultraclean: clean

clean :
    rm -f $(all) iosr-tcp.o iolsr-tcp.o iosr-async.o
    rm -f libbase.a
    @ echo "Done"

lib : libbase.a

libbase.a  : $(all)
    ar rv libbase.a $?

gc_api.o: gc_api.c ../inc/emtel_dl.h ../inc/types.h ../inc/emtel_srdev.h



In this file the default build is "build" because it is the first label in the "Makefile". Should you type "make clean" the code at the "clean:" label would be executed which remove a bunch of files then prints "Done". if the lines after the label have a space at the begining of the line then the sequence of commands is considered termnnated. To see what would happen with this file if I wanted to "make clean" I do the following:

Code:

[gwmiller@uniserv lib]$ make -n clean
rm -f link_list.o log.o tiff_util.o fields.o file_d_rtn.o mime.o gc_api.o srdev_layer.o iosr-tcp.o iolsr-tcp.o iosr-async.o
rm -f libbase.a
echo "Done"
[gwmiller@uniserv lib]$


If I put a space at the beginning of the "rm -f libbase.a" line and then do the same command:
Code:

[gwmiller@uniserv lib]$ make -n clean
rm -f link_list.o log.o tiff_util.o fields.o file_d_rtn.o mime.o gc_api.o srdev_layer.o iosr-tcp.o iolsr-tcp.o iosr-async.o
[gwmiller@uniserv lib]$


I hope this helps.

#104898 - sasuke_kun12 - Tue Oct 03, 2006 10:20 pm

i followed ur example but msys and command prompt spit this out

Code:

C:\Documents and Settings\Ryan>cd..

C:\Documents and Settings>cd..

C:\>cd triad_src

C:\triad_src>make
make[2]: /c/triad_src/build/Makefile: No such file or directory
make[2]: *** No rule to make target `/c/triad_src/build/Makefile'.  Stop.
make[1]: *** [build] Error 2
make: *** [build] Error 2

C:\triad_src>


huh?
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#104899 - tepples - Tue Oct 03, 2006 10:39 pm

Apparently the makefile is looking for another makefile in the 'build' folder.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#104901 - TheWopr - Tue Oct 03, 2006 11:01 pm

Not to sure if I'm right or not but to me, it doesn't look like its "looking" for another makefile in your build folder, it looks like there "is" another makefile in there and it doesn't know what to do with it. Check if there is a second makefile in your build folder and if there is try deleting it (or taking it out and putting it somewhere safe).

#105268 - sasuke_kun12 - Sat Oct 07, 2006 3:29 am

make works now. don't know what i did this time though! thanks for your help guys! i really appreciate it.

actually, could you guys help me out again?

now i just get errors coz of the ROTT code, do i have to port every single script?
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!