2 messages in com.perforce.jamming[jamming] ResourceCompiler rule| From | Sent On | Attachments |
|---|---|---|
| Ivet...@schema.com | 18 Oct 2000 02:12 | |
| Amau...@atsm.fr | 18 Oct 2000 05:45 |
| Subject: | [jamming] ResourceCompiler rule![]() |
|---|---|
| From: | Amau...@atsm.fr (Amau...@atsm.fr) |
| Date: | 10/18/2000 05:45:27 AM |
| List: | com.perforce.jamming |
Hello,
I want to write rule that compiles *.rc files in *.res files
My Jamrules looks like this: rule UserObject { switch $(>:S) { case .rc : ResourceCompiler $(>:S=.res) : $(>) ; case * : ECHO "unknown suffix on" $(>) ; } }
You should not use the UserObject rule, which only builds *.obj files For resources, I use the following rules:
# # Resource : builds a resource file # rule Resource { SEARCH on $(>) = $(SEARCH_SOURCE) ; MakeLocate $(<) : $(LOCATE_TARGET) ;
DEPENDS $(<) : $(>) ; Clean clean : $(<) ;
RCFLAGS on $(<) = $(RCFLAGS) /d$(RCDEFINES) ; }
actions Resource { RC $(RCFLAGS) /Fo$(<) $(>) }
# # LinkResource : Links the resource file into an executable # rule LinkResource { local t r ;
if $(<:S) { t = $(<) ; } else { t = $(<:S=$(SUFEXE)) ; }
r = $(>:S=.res) ;
DEPENDS $(t) : $(r) ; NEEDLIBS on $(t) += $(r) ; }
Then I write something like:
Main program : program.c ; Resource resource.res : resource.rc ; LinkResource program : resource.res ;
Amaury




