Opened 11 years ago

Closed 11 years ago

#37 closed enhancement (fixed)

Add support for resource compiling to GCC3OMF

Reported by: ydario Owned by: bird
Priority: major Milestone: 0.1.5
Component: kBuild Version: 0.1.3
Keywords: Cc:

Description

The patch allows gcc 3.3.5 to compile also resource files.

Index: kBuild/tools/GCC3OMF.kmk
===================================================================
--- kBuild/tools/GCC3OMF.kmk	(revision 1686)
+++ kBuild/tools/GCC3OMF.kmk	(working copy)
@@ -34,6 +34,21 @@
 TOOL_GCC3OMF := GCC v3 targeting OS/2 OMF.
 
 # Tool Specific Properties
+ifndef PATH_TOOL_GCC3OMF
+ # YD I know this not the best, but I'm sure the committer will do it better :-)
+ PATH_TOOL_GCC3OMF := f:/dev/gcc061
+ # if not found, we'll enter 'pathless' mode.
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_TOOL_GCC3OMF := $(PATH_TOOL_GCC3OMF)
+endif
+ifneq ($(PATH_TOOL_GCC3OMF),)
+ PATH_TOOL_GCC3OMF_BIN ?= $(PATH_TOOL_GCC3OMF)/bin
+ PATH_TOOL_GCC3OMF_LIB ?= $(PATH_TOOL_GCC3OMF)/lib
+ PATH_TOOL_GCC3OMF_INC ?= $(PATH_TOOL_GCC3OMF)/include
+endif
+
+# Tool Specific Properties
 TOOL_GCC3OMF_CC  ?= gcc$(HOSTSUFF_EXE)
 TOOL_GCC3OMF_CXX ?= g++$(HOSTSUFF_EXE)
 TOOL_GCC3OMF_AS  ?= gcc$(HOSTSUFF_EXE)
@@ -49,6 +64,7 @@
 TOOL_GCC3OMF_LDFLAGS.sysmod ?= -nostdlib
 TOOL_GCC3OMF_LD_MAP ?= -Zmap=$(1)
 TOOL_GCC3OMF_LD_SYSMOD_MAP ?= -Zmap=$(1)
+TOOL_GCC3OMF_RC ?= wrc$(HOSTSUFF_EXE)
 
 ifdef SLKRUNS
 TOOL_GCC3OMF_CC  += -fmessage-length=0
@@ -85,7 +101,12 @@
 TOOL_GCC3OMF_LDFLAGS.debug    ?= -g
 TOOL_GCC3OMF_LDFLAGS.profile  ?= -g
 
+TOOL_GCC3OMF_RCOBJSUFF        ?= .res
+TOOL_GCC3OMF_RCINCS           ?= $(PATH_TOOL_GCC3OMF_INC)
 
+TOOL_GCC3OMF_IPFSUFF          ?= .hlp
+
+
 ## Compile C source.
 # @param    $(target)   Normalized main target name.
 # @param    $(source)   Source filename (relative).
@@ -197,6 +218,30 @@
 endef
 
 
+## Compile resource source.
+# @param    $(target)   Normalized main target name.
+# @param    $(source)   Source filename (relative).
+# @param    $(obj)      Object file name. This shall be (re)created by the compilation.
+# @param    $(dep)      Dependcy file. This shall be (re)created by the compilation.
+# @param    $(flags)    Flags.
+# @param    $(defs)     Definitions. No -D or something.
+# @param    $(incs)     Includes. No -I or something.
+# @param    $(dirdep)   Directory creation dependency.
+# @param    $(deps)     Other dependencies.
+#
+# @param    $(outbase)  Output basename (full). Use this for list files and such.
+# @param    $(objsuff)  Object suffix.
+TOOL_GCC3OMF_COMPILE_RC_OUTPUT =
+TOOL_GCC3OMF_COMPILE_RC_DEPEND =
+TOOL_GCC3OMF_COMPILE_RC_DEPORD =
+define TOOL_GCC3OMF_COMPILE_RC_CMDS
+	$(QUIET)$(TOOL_GCC3OMF_RC) -r \
+		$(flags) $(addprefix -i, $(subst /,\\,$(incs))) $(addprefix -d, $(defs))\
+		-fo$(obj)\
+		$(subst /,\\,$(abspath $(source)))
+endef
+
+
 ## Link library
 # @param    $(target)   Normalized main target name.
 # @param    $(out)		Library name.

Change History (2)

comment:1 Changed 11 years ago by bird

  • Milestone changed from 0.1.4 to 0.1.5
  • Priority changed from minor to major

comment:2 Changed 11 years ago by bird

  • Resolution set to fixed
  • Status changed from new to closed

Implemented by the OPENWATCOM.kmk tool. Do the following to use with GCC3OMF:

TEMPLATE_mytmpl_TOOL = GCC3OMF
TEMPLATE_mytmpl_RCTOOL = OPENWATCOM
Note: See TracTickets for help on using tickets.