rules.mk 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. #! gmake
  2. #
  3. # This Source Code Form is subject to the terms of the Mozilla Public
  4. # License, v. 2.0. If a copy of the MPL was not distributed with this
  5. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  6. ################################################################################
  7. # We used to have a 4 pass build process. Now we do everything in one pass.
  8. #
  9. # export - Create generated headers and stubs. Publish public headers to
  10. # dist/<arch>/include.
  11. # Create libraries. Publish libraries to dist/<arch>/lib.
  12. # Create programs.
  13. #
  14. # libs - obsolete. Now a synonym of "export".
  15. #
  16. # all - the default makefile target. Now a synonym of "export".
  17. #
  18. # install - Install headers, libraries, and programs on the system.
  19. #
  20. # Parameters to this makefile (set these before including):
  21. #
  22. # a)
  23. # TARGETS -- the target to create
  24. # (defaults to $LIBRARY $PROGRAM)
  25. # b)
  26. # DIRS -- subdirectories for make to recurse on
  27. # (the 'all' rule builds $TARGETS $DIRS)
  28. # c)
  29. # CSRCS -- .c files to compile
  30. # (used to define $OBJS)
  31. # d)
  32. # PROGRAM -- the target program name to create from $OBJS
  33. # ($OBJDIR automatically prepended to it)
  34. # e)
  35. # LIBRARY -- the target library name to create from $OBJS
  36. # ($OBJDIR automatically prepended to it)
  37. #
  38. ################################################################################
  39. ifndef topsrcdir
  40. topsrcdir=$(MOD_DEPTH)
  41. endif
  42. ifndef srcdir
  43. srcdir=.
  44. endif
  45. ifndef NSPR_CONFIG_MK
  46. include $(topsrcdir)/config/config.mk
  47. endif
  48. ifdef USE_AUTOCONF
  49. ifdef CROSS_COMPILE
  50. ifdef INTERNAL_TOOLS
  51. CC=$(HOST_CC)
  52. CCC=$(HOST_CXX)
  53. CFLAGS=$(HOST_CFLAGS)
  54. CXXFLAGS=$(HOST_CXXFLAGS)
  55. LDFLAGS=$(HOST_LDFLAGS)
  56. endif
  57. endif
  58. endif
  59. #
  60. # This makefile contains rules for building the following kinds of
  61. # libraries:
  62. # - LIBRARY: a static (archival) library
  63. # - SHARED_LIBRARY: a shared (dynamic link) library
  64. # - IMPORT_LIBRARY: an import library, used only on Windows and OS/2
  65. #
  66. # The names of these libraries can be generated by simply specifying
  67. # LIBRARY_NAME and LIBRARY_VERSION.
  68. #
  69. ifdef LIBRARY_NAME
  70. ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH)))
  71. #
  72. # Win95 and OS/2 require library names conforming to the 8.3 rule.
  73. # other platforms do not.
  74. #
  75. ifeq (,$(filter-out WIN95 WINCE WINMO OS2,$(OS_TARGET)))
  76. SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
  77. SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
  78. ifdef MSC_VER
  79. LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
  80. IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
  81. else
  82. LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
  83. IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
  84. endif
  85. else
  86. SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
  87. SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
  88. LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
  89. IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
  90. endif
  91. else
  92. LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
  93. ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
  94. SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a
  95. else
  96. ifdef MKSHLIB
  97. SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
  98. endif
  99. endif
  100. endif
  101. endif
  102. ifndef TARGETS
  103. ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH)))
  104. TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
  105. ifdef MOZ_DEBUG_SYMBOLS
  106. ifdef MSC_VER
  107. ifneq (,$(filter-out 1100 1200,$(MSC_VER)))
  108. TARGETS += $(SHARED_LIB_PDB)
  109. endif
  110. endif
  111. endif
  112. else
  113. TARGETS = $(LIBRARY) $(SHARED_LIBRARY)
  114. endif
  115. endif
  116. #
  117. # OBJS is the list of object files. It can be constructed by
  118. # specifying CSRCS (list of C source files) and ASFILES (list
  119. # of assembly language source files).
  120. #
  121. ifndef OBJS
  122. OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
  123. $(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)))
  124. endif
  125. ALL_TRASH = $(TARGETS) $(OBJS) $(RES) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
  126. $(NOSUCHFILE) \
  127. $(OBJS:.$(OBJ_SUFFIX)=.i_o) \
  128. so_locations
  129. ifndef RELEASE_LIBS_DEST
  130. RELEASE_LIBS_DEST = $(RELEASE_LIB_DIR)
  131. endif
  132. define MAKE_IN_DIR
  133. $(MAKE) -C $(dir) $@
  134. endef # do not remove the blank line!
  135. ifdef DIRS
  136. LOOP_OVER_DIRS = $(foreach dir,$(DIRS),$(MAKE_IN_DIR))
  137. endif
  138. ################################################################################
  139. all:: export
  140. export::
  141. +$(LOOP_OVER_DIRS)
  142. libs:: export
  143. clean::
  144. rm -rf $(OBJS) $(RES) so_locations $(NOSUCHFILE) $(GARBAGE)
  145. +$(LOOP_OVER_DIRS)
  146. clobber::
  147. rm -rf $(OBJS) $(RES) $(TARGETS) $(filter-out . ..,$(OBJDIR)) $(GARBAGE) so_locations $(NOSUCHFILE)
  148. +$(LOOP_OVER_DIRS)
  149. realclean clobber_all::
  150. rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH)
  151. +$(LOOP_OVER_DIRS)
  152. distclean::
  153. rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE)
  154. +$(LOOP_OVER_DIRS)
  155. install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS)
  156. ifdef RELEASE_BINS
  157. $(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir)
  158. endif
  159. ifdef RELEASE_HEADERS
  160. $(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir)
  161. endif
  162. ifdef RELEASE_LIBS
  163. $(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
  164. endif
  165. +$(LOOP_OVER_DIRS)
  166. release:: export
  167. ifdef RELEASE_BINS
  168. @echo "Copying executable programs and scripts to release directory"
  169. @if test -z "$(BUILD_NUMBER)"; then \
  170. echo "BUILD_NUMBER must be defined"; \
  171. false; \
  172. else \
  173. true; \
  174. fi
  175. @if test ! -d $(RELEASE_BIN_DIR); then \
  176. rm -rf $(RELEASE_BIN_DIR); \
  177. $(NSINSTALL) -D $(RELEASE_BIN_DIR);\
  178. else \
  179. true; \
  180. fi
  181. cp $(RELEASE_BINS) $(RELEASE_BIN_DIR)
  182. endif
  183. ifdef RELEASE_LIBS
  184. @echo "Copying libraries to release directory"
  185. @if test -z "$(BUILD_NUMBER)"; then \
  186. echo "BUILD_NUMBER must be defined"; \
  187. false; \
  188. else \
  189. true; \
  190. fi
  191. @if test ! -d $(RELEASE_LIBS_DEST); then \
  192. rm -rf $(RELEASE_LIBS_DEST); \
  193. $(NSINSTALL) -D $(RELEASE_LIBS_DEST);\
  194. else \
  195. true; \
  196. fi
  197. cp $(RELEASE_LIBS) $(RELEASE_LIBS_DEST)
  198. endif
  199. ifdef RELEASE_HEADERS
  200. @echo "Copying header files to release directory"
  201. @if test -z "$(BUILD_NUMBER)"; then \
  202. echo "BUILD_NUMBER must be defined"; \
  203. false; \
  204. else \
  205. true; \
  206. fi
  207. @if test ! -d $(RELEASE_HEADERS_DEST); then \
  208. rm -rf $(RELEASE_HEADERS_DEST); \
  209. $(NSINSTALL) -D $(RELEASE_HEADERS_DEST);\
  210. else \
  211. true; \
  212. fi
  213. cp $(RELEASE_HEADERS) $(RELEASE_HEADERS_DEST)
  214. endif
  215. +$(LOOP_OVER_DIRS)
  216. alltags:
  217. rm -f TAGS tags
  218. find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a
  219. find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a
  220. $(NFSPWD):
  221. cd $(@D); $(MAKE) $(@F)
  222. $(PROGRAM): $(OBJS)
  223. @$(MAKE_OBJDIR)
  224. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
  225. ifdef MOZ_PROFILE_USE
  226. # In the second pass, we need to merge the pgc files into the pgd file.
  227. # The compiler would do this for us automatically if they were in the right
  228. # place, but they're in dist/bin.
  229. python $(topsrcdir)/build/win32/pgomerge.py \
  230. $(notdir $(PROGRAM:.exe=)) $(DIST)/bin
  231. endif # MOZ_PROFILE_USE
  232. $(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
  233. ifdef MT
  234. @if test -f $@.manifest; then \
  235. $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
  236. rm -f $@.manifest; \
  237. fi
  238. endif # MSVC with manifest tool
  239. ifdef MOZ_PROFILE_GENERATE
  240. # touch it a few seconds into the future to work around FAT's
  241. # 2-second granularity
  242. touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
  243. endif # MOZ_PROFILE_GENERATE
  244. else # WINNT && !GCC
  245. $(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) $(WRAP_LDFLAGS)
  246. endif # WINNT && !GCC
  247. ifdef ENABLE_STRIP
  248. $(STRIP) $@
  249. endif
  250. # Same as OBJS, but without any file that matches p*vrsion.o, since these
  251. # collide for static libraries, and are not useful for that case anyway.
  252. STATICLIB_OBJS = $(filter-out $(OBJDIR)/p%vrsion.$(OBJ_SUFFIX),$(OBJS))
  253. $(LIBRARY): $(STATICLIB_OBJS)
  254. @$(MAKE_OBJDIR)
  255. rm -f $@
  256. $(AR) $(AR_FLAGS) $(STATICLIB_OBJS) $(AR_EXTRA_ARGS)
  257. $(RANLIB) $@
  258. ifeq ($(OS_TARGET), OS2)
  259. $(IMPORT_LIBRARY): $(MAPFILE)
  260. rm -f $@
  261. $(IMPLIB) $@ $(MAPFILE)
  262. else
  263. ifeq (,$(filter-out WIN95 WINCE WINMO,$(OS_TARGET)))
  264. # PDBs and import libraries need to depend on the shared library to
  265. # order dependencies properly.
  266. $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
  267. $(SHARED_LIB_PDB): $(SHARED_LIBRARY)
  268. endif
  269. endif
  270. $(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE)
  271. @$(MAKE_OBJDIR)
  272. rm -f $@
  273. ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
  274. echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
  275. nm -B -C -g $(OBJS) \
  276. | awk '/ [T,D] / {print $$3}' \
  277. | sed -e 's/^\.//' \
  278. | sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
  279. $(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \
  280. -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
  281. else # AIX 4.1
  282. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
  283. ifdef MOZ_PROFILE_USE
  284. python $(topsrcdir)/build/win32/pgomerge.py \
  285. $(notdir $(SHARED_LIBRARY:.$(DLL_SUFFIX)=)) $(DIST)/bin
  286. endif # MOZ_PROFILE_USE
  287. $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES)
  288. ifdef MT
  289. @if test -f $@.manifest; then \
  290. $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \
  291. rm -f $@.manifest; \
  292. fi
  293. endif # MSVC with manifest tool
  294. ifdef MOZ_PROFILE_GENERATE
  295. touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
  296. endif # MOZ_PROFILE_GENERATE
  297. else # WINNT && !GCC
  298. $(MKSHLIB) $(OBJS) $(RES) $(LDFLAGS) $(WRAP_LDFLAGS) $(EXTRA_LIBS)
  299. endif # WINNT && !GCC
  300. endif # AIX 4.1
  301. ifdef ENABLE_STRIP
  302. $(STRIP) $@
  303. endif
  304. ################################################################################
  305. ifdef MOZ_PROFILE_USE
  306. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
  307. # When building with PGO, we have to make sure to re-link
  308. # in the MOZ_PROFILE_USE phase if we linked in the
  309. # MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink
  310. # file in the link rule in the GENERATE phase to indicate
  311. # that we need a relink.
  312. $(SHARED_LIBRARY): pgo.relink
  313. $(PROGRAM): pgo.relink
  314. endif # WINNT && !GCC
  315. endif # MOZ_PROFILE_USE
  316. ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
  317. ifdef NS_USE_GCC
  318. # Force rebuilding libraries and programs in both passes because each
  319. # pass uses different object files.
  320. $(PROGRAM) $(SHARED_LIBRARY) $(LIBRARY): FORCE
  321. .PHONY: FORCE
  322. endif
  323. endif
  324. ################################################################################
  325. ifdef MOZ_PROFILE_GENERATE
  326. # Clean up profiling data during PROFILE_GENERATE phase
  327. export::
  328. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
  329. $(foreach pgd,$(wildcard *.pgd),pgomgr -clear $(pgd);)
  330. else
  331. ifdef NS_USE_GCC
  332. -$(RM) *.gcda
  333. endif
  334. endif
  335. endif
  336. ################################################################################
  337. ifeq ($(OS_ARCH),WINNT)
  338. $(RES): $(RESNAME)
  339. @$(MAKE_OBJDIR)
  340. # The resource compiler does not understand the -U option.
  341. ifdef NS_USE_GCC
  342. $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
  343. else
  344. $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
  345. endif # GCC
  346. @echo $(RES) finished
  347. endif
  348. $(MAPFILE): $(LIBRARY_NAME).def
  349. @$(MAKE_OBJDIR)
  350. ifeq ($(OS_ARCH),SunOS)
  351. grep -v ';-' $< | \
  352. sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
  353. endif
  354. ifeq ($(OS_ARCH),OS2)
  355. echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@
  356. echo PROTMODE >> $@
  357. echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
  358. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
  359. echo EXPORTS >> $@
  360. grep -v ';+' $< | grep -v ';-' | \
  361. sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \
  362. awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
  363. $(ADD_TO_DEF_FILE)
  364. endif
  365. #
  366. # Translate source filenames to absolute paths. This is required for
  367. # debuggers under Windows and OS/2 to find source files automatically.
  368. #
  369. ifeq (,$(filter-out AIX OS2,$(OS_ARCH)))
  370. NEED_ABSOLUTE_PATH = 1
  371. endif
  372. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
  373. NEED_ABSOLUTE_PATH = 1
  374. endif
  375. ifdef NEED_ABSOLUTE_PATH
  376. # The quotes allow absolute paths to contain spaces.
  377. pr_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))"
  378. endif
  379. $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
  380. @$(MAKE_OBJDIR)
  381. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
  382. $(CCC) -Fo$@ -c $(CCCFLAGS) $(call pr_abspath,$<)
  383. else
  384. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINCE)
  385. $(CCC) -Fo$@ -c $(CCCFLAGS) $<
  386. else
  387. ifdef NEED_ABSOLUTE_PATH
  388. $(CCC) -o $@ -c $(CCCFLAGS) $(call pr_abspath,$<)
  389. else
  390. $(CCC) -o $@ -c $(CCCFLAGS) $<
  391. endif
  392. endif
  393. endif
  394. WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
  395. WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
  396. WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
  397. $(OBJDIR)/%.$(OBJ_SUFFIX): %.c
  398. @$(MAKE_OBJDIR)
  399. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
  400. $(CC) -Fo$@ -c $(CFLAGS) $(call pr_abspath,$<)
  401. else
  402. ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINCE)
  403. $(CC) -Fo$@ -c $(CFLAGS) $<
  404. else
  405. ifdef NEED_ABSOLUTE_PATH
  406. $(CC) -o $@ -c $(CFLAGS) $(call pr_abspath,$<)
  407. else
  408. $(CC) -o $@ -c $(CFLAGS) $<
  409. endif
  410. endif
  411. endif
  412. $(OBJDIR)/%.$(OBJ_SUFFIX): %.s
  413. @$(MAKE_OBJDIR)
  414. $(AS) -o $@ $(ASFLAGS) -c $<
  415. %.i: %.c
  416. $(CC) -C -E $(CFLAGS) $< > $*.i
  417. %: %.pl
  418. rm -f $@; cp $< $@; chmod +x $@
  419. #
  420. # HACK ALERT
  421. #
  422. # The only purpose of this rule is to pass Mozilla's Tinderbox depend
  423. # builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's
  424. # Tinderbox builds NSPR continuously as part of the Mozilla client.
  425. # Because NSPR's make depend is not implemented, whenever we change
  426. # an NSPR header file, the depend build does not recompile the NSPR
  427. # files that depend on the header.
  428. #
  429. # This rule makes all the objects depend on a dummy header file.
  430. # Touch this dummy header file to force the depend build to recompile
  431. # everything.
  432. #
  433. # This rule should be removed when make depend is implemented.
  434. #
  435. DUMMY_DEPEND_H = $(topsrcdir)/config/prdepend.h
  436. $(filter $(OBJDIR)/%.$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%.$(OBJ_SUFFIX): $(DUMMY_DEPEND_H)
  437. # END OF HACK
  438. ################################################################################
  439. # Special gmake rules.
  440. ################################################################################
  441. #
  442. # Disallow parallel builds with MSVC < 8 since it can't open the PDB file in
  443. # parallel.
  444. #
  445. ifeq (,$(filter-out 1200 1300 1310,$(MSC_VER)))
  446. .NOTPARALLEL:
  447. endif
  448. #
  449. # Re-define the list of default suffixes, so gmake won't have to churn through
  450. # hundreds of built-in suffix rules for stuff we don't need.
  451. #
  452. .SUFFIXES:
  453. .SUFFIXES: .a .$(OBJ_SUFFIX) .c .cpp .s .h .i .pl
  454. #
  455. # Fake targets. Always run these rules, even if a file/directory with that
  456. # name already exists.
  457. #
  458. .PHONY: all alltags clean export install libs realclean release
  459. #
  460. # List the target pattern of an implicit rule as a dependency of the
  461. # special target .PRECIOUS to preserve intermediate files made by
  462. # implicit rules whose target patterns match that file's name.
  463. # (See GNU Make documentation, Edition 0.51, May 1996, Sec. 10.4,
  464. # p. 107.)
  465. #
  466. .PRECIOUS: $(OBJDIR)/%.$(OBJ_SUFFIX)