Thread: [GD-Windows] Makefile woes
Brought to you by:
vexxed72
From: Brett B. <res...@ga...> - 2005-05-11 02:53:47
|
Any makefile experts that can spare a moment? Having problems with makefiles on Windows (using GNU make under Cygwin) and can't seem to figure it out or even how to google it. If anybody can point me to a mailing list or forum that is more appropriate, please let me know. All the lists I found so far aren't helpful. 1. I want to check for the existence of a directory, and if it doesn't exist create it. Most of the linux/unix examples do something like: .PHONY: $(SUBDIR) $(SUBDIR): @[ -d $(SUBDIR) ] || mkdir -p $(SUBDIR) Obviously the mkdir needs to become md, but it seems to me that the brackets and the or'ing are using the shell to test for the directory? I don't know shell commands at all and it's frustrating trying to figure out this stuff. 2. I want to do some printf style debugging beyond the -d makefile switch. Something like: <some makefile commands> echo "You got here" <some more makefile commands> But this doesn't work. What is the way/format to output messages anywhere during the make build? Any help appreciated... Mr.b |
From: Daniel G. <dgl...@cr...> - 2005-05-11 03:41:06
|
It's been more than 2 years since I had to maintain makefiles, so this is all coming from memory. Brett Bibby wrote: >1. I want to check for the existence of a directory, and if it doesn't exist >create it. > >Most of the linux/unix examples do something like: > >.PHONY: $(SUBDIR) >$(SUBDIR): > @[ -d $(SUBDIR) ] || mkdir -p $(SUBDIR) > > >Obviously the mkdir needs to become md, but it seems to me that the brackets >and the or'ing are using the shell to test for the directory? I don't know >shell commands at all and it's frustrating trying to figure out this stuff. > > [ is a exe in unix, but more likely a shell builtin these days. It might be a synonym for 'file'. But it's using circuit evaluation to test if $(SUBDIR) exists, and if it doesn't then it creates the directory. But if you're running under cygwin, you should have the unix shell, shouldn't you? (And a version of the mkdir) >2. I want to do some printf style debugging beyond the -d makefile switch. >Something like: > ><some makefile commands> >echo "You got here" ><some more makefile commands> > >But this doesn't work. What is the way/format to output messages anywhere >during the make build. > > Make builds dependencies. You can only run commands as the result of make deciding it needs to build a dependency. $(SUBDIR): @echo Creating dir $(SUBDIR)... @[ -d $(SUBDIR) ] || mkdir -p $(SUBDIR) @echo Done. Doesn't really clarify anything, does it... cheers DanG |
From: Martin S. <ms...@he...> - 2005-05-11 03:58:47
|
><some makefile commands> >echo "You got here" ><some more makefile commands> > > Shouldn't it be @echo "you got here" ? not that i've touched a makefile in over two years so..... martin |
From: Jon W. <hp...@mi...> - 2005-05-11 15:38:23
|
> Obviously the mkdir needs to become md, but it seems to me that the brackets > and the or'ing are using the shell to test for the directory? I don't know > shell commands at all and it's frustrating trying to figure out this stuff. Learning make is like learning any other language; you can't expect to go from newbie to proficient in a single week of work. If you don't know make syntax, and don't know UNIX command line shells, you may want to ask yourself why you're trying to use make syntax and UNIX command line shells to accomplish whatever your task is. Does someone else in your organization require it? If so, use them as a learning resource. There are some resources you need. The first one is a reference to the BASH shell and the typical UNIX command-line utitilies (such as '[' which is an alias for 'test'). Because you're using Cygwin, you have access to mkdir, test, cp, sed, and the other commands; you should use them if you're using the Cygwin make. If you want a reference manual for GNU make, try an online copy, such as http://theory.uwinnipeg.ca/localfiles/infofiles/make/make_toc.html If you want an example of a set of simple make files that manage to build a number of libraries and applications without recursively invoking itself, and which also collects full dependencies automatically (assuming you're using GCC), you can look at my sample here: http://www.mindcontrol.org/~hplus/makesample.html In conclusion: if you're doing this for your own edification, then keep going. It might feel frustrating, but you ARE learning an entirely new language; don't expect mastery in the first week. If you're doing this for someone else, and that someone else expects you to master it in a single week, then someone needs to adjust their expectations, or do it themselves, or help you along (obviously, the latter would be best overall). Cheers, / h+ |
From: yogiwp <yo...@gm...> - 2005-05-28 00:29:21
|
Hi, I wonder how people deal with 3dsmax export crashes during batch data build? It happens randomly and it's not the exporter's fault. Reseting the scene before loading new file helps to reduce crashes a bit, but not completely. Thanks in advance. Yogi Wahyu Prasidha www.inspiritarena.com |
From: Jon W. <hp...@mi...> - 2005-05-28 00:54:03
|
The file that the artists produce and check into the build is not the .max file; it's a rich, exported format that captures whatever we will need. The real asset build then builds from this intermediate format to an actual optimized format. The artists still revision control their .max files, but they do that on a server they organize however they want, without any engineering-imposed structure. The intermediate files, however, have that structure. Cheers, / h+ yogiwp wrote: > Hi, > > I wonder how people deal with 3dsmax export crashes during > batch data build? It happens randomly and it's not the exporter's > fault. Reseting the scene before loading new file helps to reduce > crashes a bit, but not completely. > > Thanks in advance. > > > Yogi Wahyu Prasidha > www.inspiritarena.com |
From: yogiwp <yo...@gm...> - 2005-05-28 02:04:14
|
Well, unfortunately it's kinda late for this project to switch into such process. I really was hoping for 'hacks' to get around this. Max crashes should not stop the build. One idea is to 'detect' if max hangs and kill it, continue the build, and then repeat the build (because different build runs crash on different file). I'm clueless on how to 'detect' max crashes. And I'm not even sure if this is a good idea. Anyone? Thanks. ----- Original Message ----- From: "Jon Watte" <hp...@mi...> > > The file that the artists produce and check into the build is not the > .max file; it's a rich, exported format that captures whatever we will > need. The real asset build then builds from this intermediate format to > an actual optimized format. > > The artists still revision control their .max files, but they do that on > a server they organize however they want, without any > engineering-imposed structure. The intermediate files, however, have > that structure. > > Cheers, > > / h+ |
From: Martin S. <ms...@he...> - 2005-05-28 03:56:44
|
> I'm clueless on how to 'detect' max crashes. And I'm not even sure if this > is a good idea. Anyone? In the past I've had a little util that sits doing a FindWindow on the error dialog box title every second or so then just take the resulting HWND and do SendMessage(hwnd, WM_CLOSE) to it. Martin -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 267.1.0 - Release Date: 27/05/2005 |
From: yogiwp <yo...@gm...> - 2005-05-28 05:31:11
|
Good idea! I think I can do something similar. In our case, max is started in 'silent' mode causing it to not show any dialog box (apparently including errors boxes). This is necessary because otherwise it will show dialogs about missing texture etc. and stops the build. So what I'll try is monitor max' window caption, and if it doesn't change after a while I know max is stuck. Thanks all. ----- Original Message ----- From: "Martin Slater" <ms...@he...> > > I'm clueless on how to 'detect' max crashes. And I'm not even sure if this > > is a good idea. Anyone? > > In the past I've had a little util that sits doing a FindWindow on the > error dialog box title every second or so then just take the resulting > HWND and do SendMessage(hwnd, WM_CLOSE) to it. > > Martin |