Makerules 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. #
  2. # Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
  3. #
  4. .SUFFIXES: .c .S .o .os .oS .so .a .s .i
  5. PHONY := FORCE
  6. .PHONY: dummy $(PHONY) \
  7. all check test $(clean_targets) \
  8. config dist menuconfig oldconfig release \
  9. subdirs utils help
  10. # order is important, the stripping uses STRIP_FLAGS for lib-so, but not for lib-a
  11. ifeq ($(HAVE_SHARED),y)
  12. .LIBPATTERNS: "lib%.so"
  13. libs: $(lib-so-y) $(lib-a-y)
  14. $(lib-so-y): | $(interp)
  15. else
  16. .LIBPATTERNS: "lib%.a"
  17. ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
  18. libs: $(lib-gdb-y)
  19. endif
  20. libs: $(lib-a-y)
  21. endif
  22. objs: all_objs
  23. shared_objs = $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) \
  24. $(libcrypt-so-y) $(libdl-so-y) \
  25. $(libintl-so-y) $(libm-so-y) $(libnsl-so-y) \
  26. $(libpthread-so-y) $(libpthread-nonshared-y) $(libthread_db-so-y) \
  27. $(libresolv-so-y) $(librt-so-y) \
  28. $(ldso-y) \
  29. $(libutil-so-y)
  30. ar_objs = $(libc-y) $(libc-static-y) $(libcrypt-a-y) \
  31. $(libdl-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y) \
  32. $(libpthread-a-y) $(libthread_db-a-y) \
  33. $(libresolv-a-y) $(librt-a-y) $(libutil-a-y)
  34. ifeq ($(DOPIC),y)
  35. ar_objs := $(ar_objs:.o=.os)
  36. endif
  37. flat_objs = $(lib-gdb-y)
  38. ifeq ($(HAVE_SHARED),y)
  39. all_objs: $(sort $(shared_objs) $(ar_objs))
  40. else
  41. all_objs: $(ar_objs)
  42. endif
  43. $(shared_objs) $(ar_objs): | $(sub_headers)
  44. headers-y: $(headers-y)
  45. @true
  46. MAKEFLAGS += --no-print-directory
  47. SHELL_SET_X := set +x
  48. ifneq ($(findstring s,$(MAKEFLAGS)),)
  49. export MAKE_IS_SILENT := y
  50. SECHO := -@false
  51. DISP := sil
  52. Q := @
  53. else
  54. export MAKE_IS_SILENT := n
  55. SECHO := @echo
  56. ifneq ($(V)$(VERBOSE),)
  57. SHELL_SET_X := set -x
  58. DISP := ver
  59. Q :=
  60. else
  61. DISP := pur
  62. Q := @
  63. endif
  64. endif
  65. show_objs = $(subst ../,,$@)
  66. pur_disp_compile.c = echo " "CC $(show_objs)
  67. pur_disp_compile.i = echo " "CPP $(show_objs)
  68. pur_disp_compile.s = echo " "CC-S $(show_objs)
  69. pur_disp_compile.u = echo " "CC $(show_objs)
  70. pur_disp_compile.S = echo " "AS $(show_objs)
  71. pur_disp_compile.m = $(pur_disp_compile.c)
  72. pur_disp_compile.mi= echo " "CPP-m $(show_objs)
  73. pur_disp_compile-m = echo " "CC-m $(show_objs)
  74. pur_disp_hcompile.u= echo " "HOSTCC $(show_objs)
  75. pur_disp_hcompile.o= echo " "HOSTCC-o $(show_objs)
  76. pur_disp_strip = echo " "STRIP $(STRIP_FLAGS) $@
  77. pur_disp_t_strip = echo " "STRIP $(STRIP_FLAGS) $@
  78. pur_disp_ar = echo " "AR $(ARFLAGS) $@
  79. pur_disp_ld = echo " "LD $(1)
  80. pur_disp_ln = echo " "LN $@
  81. pur_disp_mkdir = echo " "MKDIR $@
  82. pur_disp_gen = echo " "GEN $@
  83. pur_disp_unifdef = echo " "UNIFDEF $@
  84. pur_disp_rm = echo " "CLEAN $(@:_clean=)
  85. sil_disp_compile.c = true
  86. sil_disp_compile.i = true
  87. sil_disp_compile.s = true
  88. sil_disp_compile.u = true
  89. sil_disp_compile.S = true
  90. sil_disp_compile.m = true
  91. sil_disp_compile.mi= true
  92. sil_disp_compile-m = true
  93. sil_disp_hcompile.u= true
  94. sil_disp_hcompile.o= true
  95. sil_disp_strip = true
  96. sil_disp_t_strip = true
  97. sil_disp_ar = true
  98. sil_disp_ld = true
  99. sil_disp_ln = true
  100. sil_disp_mkdir = true
  101. sil_disp_gen = true
  102. sil_disp_unifdef = true
  103. sil_disp_rm = true
  104. ver_disp_compile.c = echo $(cmd_compile.c)
  105. ver_disp_compile.i = echo $(cmd_compile.i)
  106. ver_disp_compile.s = echo $(cmd_compile.s)
  107. ver_disp_compile.u = echo $(cmd_compile.u)
  108. ver_disp_compile.S = echo $(cmd_compile.S)
  109. ver_disp_compile.m = echo $(cmd_compile.m)
  110. ver_disp_compile.mi= echo $(cmd_compile.mi)
  111. ver_disp_compile-m = echo $(cmd_compile-m)
  112. ver_disp_hcompile.u= echo $(cmd_hcompile.u)
  113. ver_disp_hcompile.o= echo $(cmd_hcompile.o)
  114. ver_disp_strip = echo $(cmd_strip)
  115. ver_disp_t_strip = echo $(cmd_t_strip)
  116. ver_disp_ar = echo $(cmd_ar)
  117. ver_disp_ld =
  118. ver_disp_ln =
  119. ver_disp_mkdir =
  120. ver_disp_gen =
  121. ver_disp_unifdef = echo $(cmd_unifdef)
  122. ver_disp_rm =
  123. disp_compile.c = $($(DISP)_disp_compile.c)
  124. disp_compile.i = $($(DISP)_disp_compile.i)
  125. disp_compile.s = $($(DISP)_disp_compile.s)
  126. disp_compile.u = $($(DISP)_disp_compile.u)
  127. disp_compile.S = $($(DISP)_disp_compile.S)
  128. disp_compile.m = $($(DISP)_disp_compile.m)
  129. disp_compile.mi= $($(DISP)_disp_compile.mi)
  130. disp_compile-m = $($(DISP)_disp_compile-m)
  131. disp_hcompile.u= $($(DISP)_disp_hcompile.u)
  132. disp_hcompile.o= $($(DISP)_disp_hcompile.o)
  133. disp_strip = $($(DISP)_disp_strip)
  134. disp_t_strip = $($(DISP)_disp_t_strip)
  135. disp_ar = $($(DISP)_disp_ar)
  136. disp_ld = $($(DISP)_disp_ld)
  137. disp_ln = $($(DISP)_disp_ln)
  138. disp_mkdir = $($(DISP)_disp_mkdir)
  139. disp_gen = $($(DISP)_disp_gen)
  140. disp_unifdef = $($(DISP)_disp_unifdef)
  141. disp_rm = $($(DISP)_disp_rm)
  142. any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
  143. # ../foo/bar/baz.ext -> foo_bar_baz.ext
  144. variablify = $(subst /,_,$(subst $(top_builddir),,$(1)))
  145. # strip the top_builddir off everything to make the *string* idempotent for -C
  146. dirify = $(subst $(top_builddir),,$(patsubst -L$(top_builddir)%,-L%,$(patsubst -I$(top_builddir)%,-I%,$(1))))
  147. # True if not identical. Neither order nor whitespace nor identical flags
  148. # matter.
  149. compare_flags = \
  150. $(strip $(filter-out $(call dirify,$(cmd_$(call variablify,$(1)))), \
  151. $(call dirify,$(cmd_$(call variablify,$(@))))) \
  152. $(filter-out $(call dirify,$(cmd_$(call variablify,$(@)))), \
  153. $(call dirify,$(cmd_$(call variablify,$(1))))))
  154. # Rebuild if any prerequisite, the used CC or flags changed.
  155. # Previously used flags are stored in the corresponding .%.dep files
  156. maybe_exec = \
  157. $(if $(strip $(compare_flags) $(any-prereq)), \
  158. @set -e; \
  159. $(disp_$(1)); \
  160. $(cmd_$(1)); \
  161. echo 'cmd_$(call variablify,$@) := $(call dirify,$(cmd_$(call variablify,$1)))' >> $(dir $@).$(notdir $@).dep)
  162. CFLAGS_gen.dep = -MT $@ -MD -MP -MF $(dir $@).$(notdir $@).dep
  163. cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) $(ARCH_CFLAGS) \
  164. $(CFLAGS-$(suffix $@)) \
  165. $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $(<D)))) \
  166. $(CFLAGS-$(subst $(top_srcdir),,$(dir $<))) \
  167. $(CFLAGS-$(notdir $<)) \
  168. $(CFLAGS-$(notdir $@)) \
  169. $(CFLAGS_gen.dep)
  170. cmd_compile.i = $(cmd_compile.c:-c=-E -dD $(EXTRA_CPPFLAGS))
  171. cmd_compile.s = $(cmd_compile.c:-c=-S)
  172. cmd_compile.u = $(CC) $^ $(DEPS-$(notdir $@)) -o $@ $(CFLAGS) $(CFLAGS-$(notdir $(^D))) $(CFLAGS-$(notdir $@)) $(CFLAGS_gen.dep)
  173. cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
  174. cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
  175. cmd_compile.mi= $(cmd_compile.m:-c=-E -dD $(EXTRA_CPPFLAGS))
  176. cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@))
  177. cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^
  178. cmd_t_strip = $(STRIPTOOL) $(STRIP_FLAGS) $@
  179. cmd_ar = $(AR) $(ARFLAGS) $@ $^
  180. define do_ln
  181. @$(disp_ln)
  182. $(Q)$(LN) -fs
  183. endef
  184. define do_rm
  185. @$(disp_rm)
  186. $(Q)$(RM)
  187. endef
  188. define do_awk
  189. @$(disp_gen)
  190. $(Q)$(AWK) -f
  191. endef
  192. compile.c = @$(call maybe_exec,compile.c)
  193. compile.i = $(call maybe_exec,compile.i)
  194. compile.s = $(call maybe_exec,compile.s)
  195. compile.S = @$(call maybe_exec,compile.S)
  196. compile.m = @$(call maybe_exec,compile.m)
  197. compile.mi= $(call maybe_exec,compile.mi)
  198. compile-m = @$(disp_compile-m) ; $(cmd_compile-m) && $(cmd_t_strip)
  199. do_strip = @$(disp_strip) ; $(cmd_strip)
  200. do_t_strip= @$(disp_t_strip) ; $(cmd_t_strip)
  201. do_unifdef= @$(disp_unifdef) ; $(cmd_unifdef)
  202. hcompile.u= @$(disp_hcompile.u); $(cmd_hcompile.u)
  203. hcompile.o= @$(disp_hcompile.o); $(cmd_hcompile.o)
  204. define do_ar
  205. @$(disp_ar) ; $(cmd_ar)
  206. @$(do_t_strip)
  207. endef
  208. define compile.u
  209. @$(disp_compile.u) ; $(cmd_compile.u)
  210. @$(disp_t_strip)
  211. endef
  212. cmd_hcompile.u = $(HOSTCC) $^ $(DEPS-$(notdir $@)) -o $@ $(BUILD_LDFLAGS) $(BUILD_LDFLAGS-$(notdir $(^D))) $(BUILD_LDFLAGS-$(notdir $@)) $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
  213. cmd_hcompile.o = $(HOSTCC) $^ $(DEPS-$(notdir $@)) -c -o $@ $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
  214. define link.so
  215. $(Q)$(INSTALL) -d $(dir $@)
  216. $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
  217. @$(disp_ld)
  218. $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \
  219. $(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
  220. -Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive \
  221. $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
  222. $(Q)$(LN) -sf $(1) $@.$(2)
  223. $(Q)$(LN) -sf $(1) $@
  224. endef
  225. # CRT files needed by link-flat.so
  226. LINK_FLAT_CRTS := $(top_builddir)lib/Scrt1.o $(top_builddir)lib/crti.o \
  227. $(top_builddir)lib/crtn.o
  228. # Create a shared flat library from the archive named by the first dependency.
  229. # $@ names the shared library's .gdb file, not the flat file itself.
  230. # (This is because the .gdb suffix makes the ELF file more distinctive
  231. # than the suffixless flat file.)
  232. #
  233. # Argument 1 is the shared library file -- i.e. $(@:.gdb=) -- and argument 2
  234. # is the shared library identifier. If it wasn't for $(disp_ld), we could
  235. # avoid passing $(@:.gdb=) as an argument and use $(@:.gdb=) instead of $(1).
  236. #
  237. # This is so far only used for libc, for which we want to link the entire
  238. # libgcc into the shared object.
  239. define link-flat.so
  240. $(Q)$(INSTALL) -d $(dir $@)
  241. $(Q)$(RM) $(1) $@
  242. @$(disp_ld)
  243. $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(NOSTDLIB_CFLAGS) -o $(1) \
  244. -Wl,-elf2flt -Wl,-shared-lib-id,$(2) $(top_builddir)lib/Scrt1.o \
  245. $(top_builddir)/lib/crti.o -Wl,--whole-archive $(firstword $^) \
  246. $(LIBGCC) -Wl,--no-whole-archive $(LIBS-$(notdir $@)) $(LIBGCC) \
  247. $(top_builddir)/lib/crtn.o
  248. endef
  249. define linkm.so
  250. $(Q)$(INSTALL) -d $(dir $@)
  251. $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
  252. $(do_strip)
  253. @$(disp_ld)
  254. $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \
  255. $(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
  256. $^ \
  257. $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
  258. $(Q)$(LN) -sf $(1) $@.$(2)
  259. $(Q)$(LN) -sf $(1) $@
  260. endef
  261. CFLAGS-.os+=$(PICFLAG)
  262. CFLAGS-.oS+=$(PICFLAG) -DSHARED
  263. %.o: %.c FORCE ; $(compile.c)
  264. %.os: %.c FORCE ; $(compile.c)
  265. %.oS: %.c FORCE ; $(compile.c)
  266. %.o: %.S FORCE ; $(compile.S)
  267. %.os: %.S FORCE ; $(compile.S)
  268. %.oS: %.S FORCE ; $(compile.S)
  269. %.o: %.s FORCE ; $(compile.S)
  270. %.os: %.s FORCE ; $(compile.S)
  271. %.oS: %.s FORCE ; $(compile.S)
  272. %.i: %.c FORCE ; $(compile.i)
  273. %.i: %.S FORCE ; $(compile.i)
  274. %.s: %.c FORCE ; $(compile.s)
  275. %.s: %.S FORCE ; $(compile.s)
  276. %.dep:
  277. $(top_builddir)lib/interp.c: | $(sub_headers)
  278. $(Q)$(INSTALL) -d $(dir $@)
  279. $(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@
  280. $(Q)echo "#include <features.h>" >> $@
  281. $(Q)echo "const char __dl_ldso__[] __attribute__ ((section " \
  282. "(\".interp\"))) =\""$(SHARED_LIB_LOADER_PREFIX)/$(UCLIBC_LDSO)"\";" >> $@
  283. $(interp): $(top_builddir)lib/interp.c
  284. $(compile.c)
  285. $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
  286. $(ldso):
  287. @cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(MAJOR_VERSION),%,$(notdir $@))
  288. $(libc):
  289. @cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(MAJOR_VERSION),%,$(notdir $@))
  290. CRT := crt1
  291. ifeq ($(HAVE_SHARED)$(UCLIBC_FORMAT_SHARED_FLAT),y)
  292. CRTS=$(top_builddir)lib/$(CRT).o $(top_builddir)lib/S$(CRT).o
  293. else
  294. CRTS=$(top_builddir)lib/$(CRT).o
  295. endif
  296. ASFLAGS-$(CRT).o := -DL_$(CRT)
  297. ASFLAGS-S$(CRT).o := $(PIEFLAG) -DL_S$(CRT)
  298. $(CRTS): $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(CRT).S
  299. $(Q)$(INSTALL) -d $(dir $@)
  300. $(compile.S)
  301. $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
  302. ifeq ($(UCLIBC_CTOR_DTOR),y)
  303. CTOR_TARGETS=$(top_builddir)lib/crti.o $(top_builddir)lib/crtn.o
  304. else
  305. CTOR_TARGETS:=
  306. endif
  307. ifeq ($(UCLIBC_FORMAT_FDPIC_ELF),y)
  308. CRTRELOC=$(top_builddir)lib/crtreloc.o
  309. $(CRTRELOC): $(top_builddir)lib/%.o : $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/%.c
  310. $(Q)$(INSTALL) -d $(dir $@)
  311. $(compile.c)
  312. endif
  313. ifneq ($(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c),)
  314. CFLAGS-initfini.s := -S -g0 $(PICFLAG) -fno-inline-functions -finhibit-size-directive
  315. $(top_builddir)lib/initfini.s: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/initfini.c
  316. $(compile.c)
  317. $(top_builddir)lib/defs.h: $(top_builddir)lib/initfini.s
  318. $(Q)sed -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
  319. gawk -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp
  320. $(Q)mv $@.tmp $@
  321. $(top_builddir)lib/crti.S: $(top_builddir)lib/initfini.s $(top_builddir)lib/defs.h
  322. $(Q)sed -n -e '1,/@HEADER_ENDS/p' \
  323. -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
  324. -e '/@TRAILER_BEGINS/,$$p' $< > $@
  325. $(top_builddir)lib/crtn.S: $(top_builddir)lib/initfini.s
  326. $(Q)sed -n -e '1,/@HEADER_ENDS/p' \
  327. -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
  328. -e '/@TRAILER_BEGINS/,$$p' $< > $@
  329. $(CTOR_TARGETS): $(top_builddir)lib/%.o : $(top_builddir)lib/%.S
  330. $(Q)$(INSTALL) -d $(dir $@)
  331. $(compile.S) $(PICFLAG) $(SSP_DISABLE_FLAGS)
  332. else
  333. $(CTOR_TARGETS): $(top_builddir)lib/%.o : $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/%.S
  334. $(Q)$(INSTALL) -d $(dir $@)
  335. $(compile.S) $(PICFLAG) $(SSP_DISABLE_FLAGS)
  336. endif
  337. #ifeq ($(TARGET_ARCH),nios)
  338. #CRTS_COMPAT := $(top_builddir)lib/crt0.o
  339. #$(CRTS_COMPAT):
  340. # ln -fs crt1.o $(top_builddir)lib/crt0.o
  341. #else
  342. CRTS_COMPAT :=
  343. #endif
  344. $(crt-y): $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC)
  345. $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT) $(CRTRELOC): | headers
  346. $(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y)
  347. $(Q)$(INSTALL) -d $(dir $@)
  348. $(Q)$(RM) $@
  349. $(do_ar)
  350. $(top_builddir)lib/libpthread_nonshared.a: $(libpthread-nonshared-y)
  351. $(Q)$(INSTALL) -d $(dir $@)
  352. $(Q)$(RM) $@
  353. $(do_ar)
  354. files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \
  355. $(libm-a-y) $(libm-so-y) \
  356. $(libpthread-a-y) $(libpthread-so-y) $(libpthread-nonshared-y) \
  357. $(libthread_db-a-y) $(libthread_db-so-y) \
  358. $(librt-a-y) $(librt-so-y) $(libresolv-a-y) $(libresolv-so-y) \
  359. $(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \
  360. $(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y)
  361. .depends.dep := \
  362. $(patsubst %.o,%.o.dep,$(filter %.o,$(files.dep))) \
  363. $(patsubst %.os,%.os.dep,$(filter %.os,$(files.dep))) \
  364. $(patsubst %.oS,%.oS.dep,$(filter %.oS,$(files.dep)))
  365. # Oh, and prepend a dot to the basename so i don't have to change my habit of
  366. # calling 'size thefile.o*'
  367. .depends.dep := $(foreach f,$(.depends.dep),$(dir $(f)).$(notdir $(f)))
  368. .depends.dep := $(wildcard $(.depends.dep))
  369. FORCE:
  370. clean: objclean-y headers_clean-y
  371. realclean: clean
  372. $(Q)$(RM) $(.depends.dep)
  373. objclean-y: $(objclean-y)
  374. headers_clean-y: $(headers_clean-y)
  375. ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
  376. ifneq ($(strip $(.depends.dep)),)
  377. .NOEXPORT:
  378. -include $(.depends.dep)
  379. endif
  380. endif
  381. # vi: ft=make :