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.

Beginners > Running msys's make.exe from PN2.

#92367 - jake2431 - Thu Jul 13, 2006 4:33 am

I am trying to move from HAM to devkitPro and am right now trying to set up Programmers Notepad 2 so that it will compile my programs for me. I am using TONC and have checked twice and think that I have it set up exactly like Cearn says to, but when I press F9 I get:

Code:
> "C:\devkitPro\msys\bin\make.exe" -f first.c build
first.c:1: *** missing separator.  Stop.

> Process Exit Code: 2
> Time Taken: 00:00


I've also looked at the devkitPro site's FAQ section and saw that it uses the Alt+1 to run the make, but that doesn't work either. I know I am doing somethig wrong, but I am not sure exactly what.

#92388 - entilzha - Thu Jul 13, 2006 9:02 am

Yeah, I had the same thing.. It is a mistake in Tonc I think.. I will send the guy an e-mail about it. The problem is you don't need:

Code:
> "C:\devkitPro\msys\bin\make.exe" -f first.c build


but rather

Code:
> "C:\devkitPro\msys\bin\make.exe" -f first.mak build


You can make it like this by replacing the "-f %f build" in the Parameters by "-f %n.mak build". Then it will also work for all the other code examples in Tonc. Note you also need to put "-f %n.mak clean" for the make clean (F10) command.

#92443 - jake2431 - Thu Jul 13, 2006 4:09 pm

Thanks! works great! Yeah, let Cearn know.

#92501 - Cearn - Thu Jul 13, 2006 6:03 pm

PN's rules are associated by filetype and it'll run the rules for the currently active file. I think what you're trying to do is use the commands with a C-file active, right? That's the only way I can see %f turn into 'first.c'. Activate the makefile and it should run fine.

Or you could use '%n.mak', and run from the C-file, but that has a few downsides. Even though it works, it's not really correct. But more importantly, it only works if the makefile has the same basename as the C-file, which will probably not be the case for anything but the smallest projects.

Another alternative is to use the name 'Makefile' instead of something with extensions. That's what PN looks for in the first place. I just don't like it much because you can't associate extensionless files with apps in Windows and opening them becomes a drag.

#92508 - wintermute - Thu Jul 13, 2006 6:27 pm

PN's rules aren't necessarily associated by filetype. The default rules I added for devkitPro are global tools which operate regardless of the current file. They run make in the project directory, i.e. the directory where the .pnproj file may be found. From experimentation it appears that in the absence of a project file PN2 assumes that the directory of the file last opened is the project directory.

Personally I've never had any trouble double clicking a .pnproj file & running make from there or running make from a shell. I run from a shell pretty rarely but I'd rather just type "make" than "make -f blah.mak" so I always stick with the default name make expects.

As for opening a makefile, I've never really had the need to open it outside a project I'm building - why would you edit it in something that you're not going to run it from? All the editors I use can capture output and allow me to double click on errors & go straight to the line in question. Maybe I'm just weird and/or used to switching between linux & windows but I've never found extentionless files to be a problem at all.

In keeping with the general ease of use I've tried to maintain in the devkitPro toolchains, the template projects can be simply copied somewhere else, files added to the various directories and everything "just works"TM. The files you add will even show up in PN2's file tree after a reload or refresh.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#92514 - jake2431 - Thu Jul 13, 2006 7:02 pm

Okay(regarding Cearn), so by activate the makefile you just mean open it in PN and then hit F9 right(because that worked)? So this is the proper way that I should have PN setup from now on? I won't run into any problems with this setup as long and there is a valid makefile within my project folder in the future correct?

Now(regarding wintermute), what else needed to be added to your default settings to make it work. I am new to all of this and don't yet understand everything you are saying.

Regarding both, witch method should I use Cearn's or Wintermute's?

Lastly, thanks guys.

#92524 - Cearn - Thu Jul 13, 2006 7:29 pm

jake2431 wrote:
Okay(regarding Cearn), so by activate the makefile you just mean open it in PN and then hit F9 right(because that worked)? So this is the proper way that I should have PN setup from now on? I won't run into any problems with this setup as long and there is a valid makefile within my project folder in the future correct?

Pretty much.

jake2431 wrote:
Now(regarding wintermute), what else needed to be added to your default settings to make it work. I am new to all of this and don't yet understand everything you are saying.
You may have to set some directories differently (or change your directory structure to what the makefiles want). Copy-paste the template from the gba examples, rename the directory to your project's purposes (or not), and go. Don't expect to understand what the makefiles actually do anytime soon though :P

jake2431 wrote:
Regarding both, witch method should I use Cearn's or Wintermute's?
Lastly, thanks guys.

Wintermute's method is best for general stuff. It is nice if you don't have to worry about filenames, etc. when building projects. With devkitPro's templates all you have to do is copy-paste the makefile and it runs.

Well, usually ...
the PN build I just did wrote:
collect2: CreateProcess: No such file or directory

Y hello thar. Where have I seen you before. ETA: the problem is the parentheses in the system-path, which sometimes have to be there because that's the only way to deal with the spaces-in-paths that Windows is so fond of. Riiight. Five minutes with the guy who okayed the spaces-in-paths idea and a rusty spoon. Please. >_<

Anyway, not all editors allow you to run stuff on extensionless files, but it's not a problem with PN. It's really a matter of personal preference I guess. I still often have makefiles open for testing purposes or seeing how they're written, at which time it becomes annoying if you can't open them from explorer directly. But I don't think this would apply to most people, so do what you like best.

#92572 - wintermute - Thu Jul 13, 2006 11:19 pm

There's always the right click & open with menu See this link for some lowdown

I'm nearly sure I remember some method of choosing a default catchall application for files without an association but I might be thinking of GEM rather than Windows.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#92578 - Cearn - Thu Jul 13, 2006 11:45 pm

wintermute wrote:
There's always the right click & open with menu See this link for some lowdown.

Yes, but as far as I've been able to make out, that only works for extensions :P

wintermute wrote:
I'm nearly sure I remember some method of choosing a default catchall application for files without an association but I might be thinking of GEM rather than Windows.
I'm sure there is, after all some applications seem to manage tp be on the context menu for unused filetypes. But I don't have the slightest idea how to do that.

ETA: GIMF
Basically, create a reg-key in HKEY_CLASSES_ROOT for "." and give it the value "txtfile". That will bind extensionless files to notepad. For PN, use "PN2.pnproj.1". Nothing like a default bind for not-associatedfile yet though.

#92594 - jake2431 - Fri Jul 14, 2006 1:24 am

Well, the setup from TONC is working now so I guess I will stick with it since I won't have to change the settings for that anytime in the future. I just want a setup that works with small and large project that has a good lifespan(as in I want have to change it from project to project).

Thanks guys. Always a big help.