source: branches/libc-0.6/src/emx/templates.smak@ 2515

Last change on this file since 2515 was 2203, checked in by bird, 20 years ago

Ensure that the dirs are created.

  • Property cvs2svn:cvs-rev set to 1.8
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1
2
3# Generate compilation rule for a c file
4define def_compile_c
5$$.$(call OBJFILE,$(1)): $(1) | $(dir $$.$(call OBJFILE,$(1)))
6 $$(call DO.COMPILE.c,$(.TCF) $(.TCF.$(1)))
7endef
8
9# Generate compilation rule for a S file
10define def_compile_S
11$$.$(call OBJFILE,$(1)): $(1) | $(dir $$.$(call OBJFILE,$(1)))
12 $$(call DO.COMPILE.s,$(.TSF) $(.TSF.$(1)))
13endef
14
15# Generate compilation rule for an asm files
16define def_compile_asm
17$$.$(call OBJFILE,$(1)): $(1) | $(dir $$.$(call OBJFILE,$(1)))
18 $$(call DO.COMPILE.asm,$(.TAF) $(.TAF.$(1)))
19endef
20
21# Linking rule for an EXE.
22define def_link_exe
23$$.$(.TARG): $(.OBJS) $(.DEPS)
24 $$(call DO.LINK.exe,$(.TLDF))
25endef
26
27# Linking rule for a DLL.
28define def_link_dll
29$$.$(.TARG): $(.OBJS) $(.DEPS) $(.TDEF)
30 $$(call DO.LINK.dll,$(.TLDF))
31endef
32
33# generic rule for building libs.
34define def_lib
35$$.$(.TARG): $(.OBJS) $(.DEPS)
36 $$(DO.LIBRARY)
37endef
38
39# The rule for building an archive with lot's of arguments.
40define def_lib_ar
41$$.$(.TARG): $(.OBJS) $(.DEPS)
42 echo "CREATE $$(@F)" > $$@.ar-script
43 $(foreach x, $(filter %.o, $(sort $(.OBJS) $(.DEPS))), $(call def_lib_ar_addmod))
44 echo "SAVE" >> $$@.ar-script
45 echo "END" >> $$@.ar-script
46 rm -f $$(@F) $$@
47 ar -M < $$@.ar-script
48 mv $$(@F) $$@
49
50endef
51
52# defined used by def_lib_ar to add a module to the script file. (blank line is imporant!)
53define def_lib_ar_addmod
54 echo "ADDMOD $(x)" >> $$@.ar-script
55
56endef
57
58# The rule for building an archive with imports
59define def_implib
60$$.$(.TARG): $(.IMPS) $(.OBJS) $(.DEPS)
61 $$(call DO.IMPLIB)
62endef
63
Note: See TracBrowser for help on using the repository browser.