| 1 | # This submakefile is included from mklib.smak and mkimplib.smak to define
|
|---|
| 2 | # the rules required for building an OMF variant from the a.out library.
|
|---|
| 3 |
|
|---|
| 4 | # The rule for building the OMF variant of library from a.out format
|
|---|
| 5 | ifneq ($(findstring aout,$(.TKIND)),)
|
|---|
| 6 |
|
|---|
| 7 | # Remove the .a suffix from library name
|
|---|
| 8 | .TARGET := $(patsubst %.a,%,$(.TARGET))
|
|---|
| 9 |
|
|---|
| 10 | # Replace 'aout' with 'omf' in .TKIND
|
|---|
| 11 | .TKIND := $(subst aout,omf,$(.TKIND))
|
|---|
| 12 |
|
|---|
| 13 | # Compute the new output file directory
|
|---|
| 14 | .TKIND.DIR := $(subst $(SPACE),-,$(.TKIND))/
|
|---|
| 15 |
|
|---|
| 16 | # Append the .lib suffix to target name
|
|---|
| 17 | .TARGET := $(.TARGET).lib
|
|---|
| 18 |
|
|---|
| 19 | # Compute the name of target file to build
|
|---|
| 20 | .TARG@OMF := $(.TKIND.DIR)$(.TARGET)
|
|---|
| 21 |
|
|---|
| 22 | # The rule for building the xxx@omf variant of target
|
|---|
| 23 | .PHONY: $(.MODULE)@omf
|
|---|
| 24 |
|
|---|
| 25 | MODULES += $(.MODULE)@omf
|
|---|
| 26 |
|
|---|
| 27 | DO.INSTALL += $(call CP,$.$(.TARG@OMF),$(INS)$(.INSDIR)$(.TARGET))$(NL)
|
|---|
| 28 |
|
|---|
| 29 | .DIRS@OMF := $(dir $.$(.TARG@OMF))
|
|---|
| 30 |
|
|---|
| 31 | TARGDIRS += $(.DIRS@OMF)
|
|---|
| 32 |
|
|---|
| 33 | $(.MODULE)@omf: $(.MODULE) $(.DIRS@OMF) $.$(.TARG@OMF)
|
|---|
| 34 |
|
|---|
| 35 | # Add a dependency rule to help make
|
|---|
| 36 | # (avoids that dumb 'dunno how to make' message)
|
|---|
| 37 | RULES += $(call FECHO,_@,$.$(.TARG@OMF): $.$(.TARG))$(NL)
|
|---|
| 38 |
|
|---|
| 39 | endif # neq ($(findstring aout,$(.TKIND)),)
|
|---|