|
MinGW makefiles |
23yrold3yrold
Member #1,134
March 2001
|
Interesting one here; how do I go about including a .rc file in a makefile for compiling? Here's my newbie makefile:
So where and how does the resource file go -- |
dudaskank
Member #561
July 2000
|
Well, never used resourcee files, but if you want to compile too, add it to the temp var... But I'm level 0 in makefiles....
Toque a balada do amor inabalável, eterna love song de nós dois |
ReyBrujo
Moderator
January 2001
|
It should look something like myresource.o : myresource.rc windres [parameters] -o $< $^ Or something like that. Check Allegro makefile, which uses one in the demo example. I am at work, and don't have that, but it is like any other program. -- |
Peter Hull
Member #1,136
March 2001
|
If it were me, I'd
|
Evert
Member #794
November 2000
|
I have RESOURCE = obj/mingw/resource.o ... GOBJS += $(RESOURCE) ... $(RESOURCE): src/resource.rc gfx/game.ico windres -O coff -o $@ -i $< $(EXEF): $(GOBJS) $(CC) $(CFLAGS) $(LFLAGS) $(GOBJS) -o $@ $(LIBS) You will probably want the windres line. |
spellcaster
Member #1,493
September 2001
|
Speaking of mingW: -- |
Evert
Member #794
November 2000
|
Quote: Why has the latest version renamed executables for make, gcc and g++?
They're no longer called make, gcc and g++? |
gillius
Member #119
April 2000
|
I don't know but I would like to know very much, because it has screwed up my GNE installer program on MingW2. Edit: Evert: I know that make is now "make-mingw32.exe". I didn't think g++ had changed? But several of the items were renamed to append -mingw32 to their filenames. Gillius |
Evert
Member #794
November 2000
|
That sucks. Badly. It means all my makefiles are broken for newer versions of MinGW. Will the tools work if you rename them? |
gillius
Member #119
April 2000
|
Yes. That's what I did personally, and what I've told all of my programming friends to do (well at first I told them to copy the file so that it has both names). It's really lame imho. It works perfectly fine to rename the stuff. With this and the whole including windows.h with the standard header files and I'm extraordinarily dissapointed with the MingW 2.0 release. The GCC 3.2 compiler is awesome, but now I have to do 2 workarounds to compile Allegro code, because you have to define that lame _GTHREAD_HIDE_API or whatever symbol to get rid of the windows.h. Gillius |
spellcaster
Member #1,493
September 2001
|
I simply copied the make file and renamed the copy. -- |
Peter Hull
Member #1,136
March 2001
|
On a sensible OS you'd symlink make to make-mingw32
|
Thomas Fjellstrom
Member #476
June 2000
|
Quote: Guess I need to make a clean install of everything (ming, allegro, fblend) especially if you use C++. 3.1, 3.0 and 2.95.* all use a different method to munge variable names. (none are compatible) -- |
23yrold3yrold
Member #1,134
March 2001
|
Okay, I'm taking another stab at this. Makefile syntax has always eluded me, so this is really frustrating What have I done wrong here? I get "Makefile:7: *** missing seperator. Stop." Dunno what a seperator is though ....
-- |
Matthew Leverton
Supreme Loser
January 1999
|
Make sure it's a [TAB]: Rsrc.o: rsrc.rc |
23yrold3yrold
Member #1,134
March 2001
|
Whoops. Thanks. I had some more fubarness but I think I got it now ...
Seems to work I have no idea what "$< $^" is supposed to mean though .... EDIT: Scratch that .... windres -O coff -o rsrc.rc rsrc.rc windres: rsrc.rc:1: parse error \DEV-CPP\BIN\..\lib\gcc-lib\mingw32\2.95.3-6\cpp0.exe: stdout: Broken pipe C:\DEV-CPP\BIN\MAKE.EXE: *** [Rsrc.o] Error 1
-- |
Thomas Fjellstrom
Member #476
June 2000
|
Your rc file is fubar'ed. Quote: windres: rsrc.rc:1: parse error
Quote: I have no idea what "$< $^" is supposed to mean though That you could find by RTFMing The make manual is fairly logical. Check google for an online one. -- |
23yrold3yrold
Member #1,134
March 2001
|
I have looked through it; it breaks my brain. And my .rc file should be just peachy; Dev-C++ compiles it fine ... EDIT: DAMMIT!!! Running that makefile totally ruined my resource file!!! Now I have to rewrite the whole bloody thing .... -- |
Thomas Fjellstrom
Member #476
June 2000
|
I think you need to set the type of the input and output files... heres the line that I use... windres -F pe-i386 -I rc -O COFF -i input.rc -o output.o If you need to know what any of that means: C:\blah>windres --help
-- |
23yrold3yrold
Member #1,134
March 2001
|
Well, I had copied my dialog scripts into my dialog-making notes, so that wasn't too much work (whew). Anyway, "windres --help" = "crapload of text that whizzes by and I can't read it". Maybe I'll go dig up the make docs and see if I can't figure out a little more. See if I can decipher your little line there ..... -- |
Thomas Fjellstrom
Member #476
June 2000
|
um... 23.. You just redirect all that to a file, or get 'less'. Then do: 'windres --help | less'. Then less will 'page' the program, and let you scoll the text up and down. -- |
23yrold3yrold
Member #1,134
March 2001
|
I used your line, slightly modified: rsrc.o : rsrc.rc windres -F pe-i386 -I rc -O COFF -i rsrc.rc -o rsrc.o It compiles, but all the resources are missing in the program. No dialogs, no menus, no cursors, etc. I'm reading the make docs now, but my main curiosity is what's supposed to "compile" the resource file. It's not exactly standard C/C++ ... I tried this line too; same result: windres --use-temp-file -I rc -O coff -i rsrc.rc -o rsrc.o Just trying random stuff until I find the info in the docs ... -- |
Thomas Fjellstrom
Member #476
June 2000
|
I know it works for me How are you using the resources? -- |
23yrold3yrold
Member #1,134
March 2001
|
Reply 23 .... Never mind; I got it. Look at the complete makefile I posted up there; I put rsrc.o in the prerequisites, but I didn't actually link it in the command. Here's my final effort:
By jove, I think I've got it .... -- |
|