source: trunk/src/emx/common.smak@ 175

Last change on this file since 175 was 156, checked in by zap, 22 years ago

o Modified makefiles so that os2.a builds correctly (with Vio, Kbd and friends,

not just from the import files).

o Moved os2.smak to the os2_386 directory (tcp32dll.imp will go into socket.a).
o Added the rules into libc.smak to build libc##.dll (finally it links without

errors! Don't know if it works, though ;-)

o Fixed emxbind so that it doesn't add underscores to exported symbols (taken

from the EXPORTS section of a .def file).

o Fixed emxexp so that it doesn't remove underscores from symbol names.
o Fixed all references to OS/2 functions to not contain an initial underscore

(since they are _System now).

o Added one builder makefile: mkimplib.smak, and two auxiliary submakefiles:

mkomflib.smak (included from both mklib and mkimplib), and a version.smak
that contains the version number, description and copyright for libc.

o Made a lot of small changes in order to remove duplicate symbols in libc.dll.
o Added sys/settime.c which was missing in EMX's -Zomf -Zsys variant.

  • Property cvs2svn:cvs-rev set to 1.5
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1# The common submakefile used for building all kinds of targets.
2
3ifdef .MODULE
4# If this is the first target in this module, add it to global variables
5ifeq ($(findstring $(.MODULE),$(MODULES)),)
6.PHONY: $(.MODULE)
7MODULES += $(.MODULE)
8ifdef .MDESC
9DO.HELP.MODULES += $(call ECHO, $(.MODULE) - $(.MDESC))$(NL)
10.MDESC :=
11endif # def .MDESC
12ifdef .MDEP
13$(.MODULE): $(.MDEP)
14.MDEP :=
15endif # def .MDEP
16endif # eq ($(findstring $(.MODULE),$(MODULES)),)
17endif # def .MODULE
18
19# Canonicalize target kind to the form objectformat-threadness{-profiling}
20ifneq ($(findstring aout,$(.TKIND)),)
21.tmp := aout
22else
23.tmp := omf
24endif # neq ($(findstring aout,$(.TKIND)),)
25ifneq ($(findstring prof,$(.TKIND)),)
26.tmp += prof
27endif # neq ($(findstring prof,$(.TKIND)),)
28.TKIND := $(.tmp)
29.TKIND.DIR := $(subst $(SPACE),-,$(.TKIND))/
30.DIRS :=
31
32ifdef .TARGET
33
34# .TARG is same as .TARGET except that it has a st/ or mt/ prefix
35.TARG := $(.TKIND.DIR)$(.TARGET)
36.DIRS += $.$(.TKIND.DIR)
37
38ifdef .INSDIR
39DO.INSTALL += $(call CP,$.$(.TARG),$(INS)$(.INSDIR)$(.TARGET))$(NL)
40INSDIRS += $(INS)$(.INSDIR)
41endif # def .INSDIR
42
43# We know how to create dependency files for .c and .cpp files
44.tmp := $(strip $(filter %.c,$(.TSRC)) $(filter %.cpp,$(.TSRC)))
45ifdef .tmp
46# Read the dependency file
47-include $.$(.TKIND.DIR)dep-$(.TARGET).smak
48
49TARGDEPEND += $.$(.TKIND.DIR)dep-$(.TARGET).smak
50
51ifdef BUILD_DEPS
52# How to build the dependency file
53$.$(.TKIND.DIR)dep-$(.TARGET).smak: $(.tmp)
54 $(DO.DEPS)
55endif # BUILD_DEPS
56endif # def .tmp
57
58endif # def .TARGET
59
60# If module has any source files, find respective object file names
61# and directories where they will be built
62ifdef .TSRC
63
64.OBJS := $(addprefix $.,$(call OBJFILE,$(.TSRC)))
65.DIRS += $(sort $(dir $(.OBJS)))
66
67# Remove the names of files for which we already generated build rules
68# so that we won't generate same rule twice. In general this is not very
69# correct since two targets may want a object file compiled with different
70# options (e.g. .TCF) but we assume that the developer knows what's doing.
71ifndef BUILD.RULES
72# We need BUILD.RULES to be a expand-value-on-assignment type variable,
73# rather than expand-value-on-reference.
74BUILD.RULES :=
75endif
76.TSRC := $(filter-out $(BUILD.RULES),$(join $(addsuffix :,$(.OBJS)),$(.TSRC)))
77BUILD.RULES += $(.TSRC)
78.TSRC := $(filter-out $(.OBJS),$(subst :, ,$(.TSRC)))
79
80# Generate compilation rules for C files
81RULES += $(foreach x,$(filter %.c,$(.TSRC)),\
82 $(call FECHO,_@,$$.$(call OBJFILE,$x): $x)$(NL)\
83 $(call FECHO,_@, $$(call DO.COMPILE.c,$(.TCF) $(.TCF.$x)))$(NL)\
84)
85
86# Generate compilation rules for S files
87RULES += $(foreach x,$(filter %.s,$(.TSRC)),\
88 $(call FECHO,_@,$$.$(call OBJFILE,$x): $x)$(NL)\
89 $(call FECHO,_@, $$(call DO.COMPILE.s,$(.TSF) $(.TSF.$x)))$(NL)\
90)
91
92# Generate compilation rules for asm files
93RULES += $(foreach x,$(filter %.asm,$(.TSRC)),\
94 $(call FECHO,_@,$$.$(call OBJFILE,$x): $x)$(NL)\
95 $(call FECHO,_@, $$(call DO.COMPILE.asm,$(.TAF) $(.TAF.$x)))$(NL)\
96)
97
98endif # def .TSRC
99
100# Add target directories to module dependencies and to overall list of dirs
101ifneq ($(.DIRS),)
102TARGDIRS += $(.DIRS)
103ifdef .MODULE
104$(.MODULE): $(.DIRS)
105endif # def .MODULE
106endif # neq ($(.DIRS),)
107
108# Add the target to the list of module dependencies
109ifdef .TARGET
110$(.MODULE): $.$(.TARG)
111endif # def .TARGET
112
113# Replace the special sequence in .TDEP @O@ with $.$(.TKIND.DIR)
114.DEPS := $(subst @O@,$.$(.TKIND.DIR),$(.TDEP))
Note: See TracBrowser for help on using the repository browser.