You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile.housekeeping 29KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027
  1. # -*- makefile -*- : Force emacs to use Makefile mode
  2. #
  3. # This file contains various boring housekeeping functions that would
  4. # otherwise seriously clutter up the main Makefile.
  5. ###############################################################################
  6. #
  7. # Find a usable "echo -e" substitute.
  8. #
  9. TAB := $(shell $(PRINTF) '\t')
  10. ECHO_E_ECHO := $(ECHO)
  11. ECHO_E_ECHO_E := $(ECHO) -e
  12. ECHO_E_BIN_ECHO := /bin/echo
  13. ECHO_E_BIN_ECHO_E := /bin/echo -e
  14. ECHO_E_ECHO_TAB := $(shell $(ECHO_E_ECHO) '\t' | cat)
  15. ECHO_E_ECHO_E_TAB := $(shell $(ECHO_E_ECHO_E) '\t' | cat)
  16. ECHO_E_BIN_ECHO_TAB := $(shell $(ECHO_E_BIN_ECHO) '\t')
  17. ECHO_E_BIN_ECHO_E_TAB := $(shell $(ECHO_E_BIN_ECHO_E) '\t')
  18. ifeq ($(ECHO_E_ECHO_TAB),$(TAB))
  19. ECHO_E := $(ECHO_E_ECHO)
  20. endif
  21. ifeq ($(ECHO_E_ECHO_E_TAB),$(TAB))
  22. ECHO_E := $(ECHO_E_ECHO_E)
  23. endif
  24. ifeq ($(ECHO_E_BIN_ECHO_TAB),$(TAB))
  25. ECHO_E := $(ECHO_E_BIN_ECHO)
  26. endif
  27. ifeq ($(ECHO_E_BIN_ECHO_E_TAB),$(TAB))
  28. ECHO_E := $(ECHO_E_BIN_ECHO_E)
  29. endif
  30. .echocheck :
  31. ifdef ECHO_E
  32. @$(TOUCH) $@
  33. else
  34. @$(PRINTF) '%24s : x%sx\n' 'tab' '$(TAB)'
  35. @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_ECHO) \t"' \
  36. '$(ECHO_E_ECHO_TAB)'
  37. @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_ECHO_E) \t"' \
  38. '$(ECHO_E_ECHO_E_TAB)'
  39. @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_BIN_ECHO) \t"' \
  40. '$(ECHO_E_BIN_ECHO_TAB)'
  41. @$(PRINTF) '%24s : x%sx\n' '"$(ECHO_E_BIN_ECHO_E) \t"' \
  42. '$(ECHO_E_BIN_ECHO_E_TAB)'
  43. @$(ECHO) "No usable \"echo -e\" substitute found"
  44. @exit 1
  45. endif
  46. MAKEDEPS += .echocheck
  47. VERYCLEANUP += .echocheck
  48. echo :
  49. @$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
  50. ###############################################################################
  51. #
  52. # Generate a usable "seq" substitute
  53. #
  54. define seq
  55. $(shell awk 'BEGIN { for ( i = $(1) ; i <= $(2) ; i++ ) print i }')
  56. endef
  57. ###############################################################################
  58. #
  59. # Determine host OS
  60. #
  61. HOST_OS := $(shell uname -s)
  62. hostos :
  63. @$(ECHO) $(HOST_OS)
  64. ###############################################################################
  65. #
  66. # Determine compiler
  67. CCDEFS := $(shell $(CC) -E -x c -c /dev/null -dM | cut -d" " -f2)
  68. ccdefs:
  69. @$(ECHO) $(CCDEFS)
  70. ifeq ($(filter __ICC,$(CCDEFS)),__ICC)
  71. CCTYPE := icc
  72. else
  73. CCTYPE := gcc
  74. endif
  75. cctype:
  76. @$(ECHO) $(CCTYPE)
  77. ###############################################################################
  78. #
  79. # Check for tools that can cause failed builds
  80. #
  81. .toolcheck :
  82. @if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; then \
  83. $(ECHO) 'gcc 2.96 is unsuitable for compiling Etherboot'; \
  84. $(ECHO) 'Use gcc 2.95 or gcc 3.x instead'; \
  85. exit 1; \
  86. fi
  87. @if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; then \
  88. $(ECHO) 'Your Perl version has a Unicode handling bug'; \
  89. $(ECHO) 'Execute this command before compiling Etherboot:'; \
  90. $(ECHO) 'export LANG=$${LANG%.UTF-8}'; \
  91. exit 1; \
  92. fi
  93. @$(TOUCH) $@
  94. MAKEDEPS += .toolcheck
  95. VERYCLEANUP += .toolcheck
  96. ###############################################################################
  97. #
  98. # Check for various tool workarounds
  99. #
  100. # Make syntax does not allow use of comma or space in certain places.
  101. # This ugly workaround is suggested in the manual.
  102. #
  103. COMMA := ,
  104. EMPTY :=
  105. SPACE := $(EMPTY) $(EMPTY)
  106. # Check for an old version of gas (binutils 2.9.1)
  107. #
  108. OLDGAS := $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)
  109. CFLAGS += $(OLDGAS)
  110. oldgas :
  111. @$(ECHO) $(oldgas)
  112. # Some widespread patched versions of gcc include -fstack-protector by
  113. # default, even when -ffreestanding is specified. We therefore need
  114. # to disable -fstack-protector if the compiler supports it.
  115. #
  116. ifeq ($(CCTYPE),gcc)
  117. SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
  118. -o /dev/null >/dev/null 2>&1
  119. SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
  120. CFLAGS += $(SP_FLAGS)
  121. endif
  122. # gcc 4.4 generates .eh_frame sections by default, which distort the
  123. # output of "size". Inhibit this.
  124. #
  125. ifeq ($(CCTYPE),gcc)
  126. CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \
  127. -o /dev/null >/dev/null 2>&1
  128. CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm')
  129. CFLAGS += $(CFI_FLAGS)
  130. endif
  131. # Some versions of gas choke on division operators, treating them as
  132. # comment markers. Specifying --divide will work around this problem,
  133. # but isn't available on older gas versions.
  134. #
  135. DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null
  136. DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide')
  137. ASFLAGS += $(DIVIDE_FLAGS)
  138. ###############################################################################
  139. #
  140. # Build verbosity
  141. #
  142. ifeq ($(V),1)
  143. Q :=
  144. QM := @\#
  145. else
  146. Q := @
  147. QM := @
  148. endif
  149. ###############################################################################
  150. #
  151. # Set BIN according to whatever was specified on the command line as
  152. # the build target.
  153. #
  154. # Determine how many different BIN directories are mentioned in the
  155. # make goals.
  156. #
  157. BIN_GOALS := $(filter bin/% bin-%,$(MAKECMDGOALS))
  158. BIN_GOAL_BINS := $(foreach BG,$(BIN_GOALS),$(firstword $(subst /, ,$(BG))))
  159. NUM_BINS := $(words $(sort $(BIN_GOAL_BINS)))
  160. ifeq ($(NUM_BINS),0)
  161. # No BIN directory was specified. Set BIN to "bin" as a sensible
  162. # default.
  163. BIN := bin
  164. else # NUM_BINS == 0
  165. ifeq ($(NUM_BINS),1)
  166. # If exactly one BIN directory was specified, set BIN to match this
  167. # directory.
  168. #
  169. BIN := $(firstword $(BIN_GOAL_BINS))
  170. else # NUM_BINS == 1
  171. # More than one BIN directory was specified. We cannot handle the
  172. # latter case within a single make invocation, so set up recursive
  173. # targets for each BIN directory.
  174. #
  175. # Leave $(BIN) undefined. This has implications for any target that
  176. # depends on $(BIN); such targets should be made conditional upon the
  177. # existence of $(BIN).
  178. #
  179. $(BIN_GOALS) : % : BIN_RECURSE
  180. $(Q)$(MAKE) --no-print-directory BIN=$(firstword $(subst /, ,$@)) $@
  181. .PHONY : BIN_RECURSE
  182. endif # NUM_BINS == 1
  183. endif # NUM_BINS == 0
  184. ifdef BIN
  185. # Create $(BIN) directory if it doesn't exist yet
  186. #
  187. ifeq ($(wildcard $(BIN)),)
  188. $(shell $(MKDIR) -p $(BIN))
  189. endif
  190. # Target to allow e.g. "make bin-efi arch"
  191. #
  192. $(BIN) :
  193. @# Do nothing, silently
  194. .PHONY : $(BIN)
  195. # Remove everything in $(BIN) for a "make clean"
  196. #
  197. CLEANUP += $(BIN)/*.* # Avoid picking up directories
  198. endif # defined(BIN)
  199. # Determine whether or not we need to include the dependency files
  200. #
  201. NO_DEP_TARGETS := $(BIN) clean veryclean
  202. ifeq ($(MAKECMDGOALS),)
  203. NEED_DEPS := 1
  204. endif
  205. ifneq ($(strip $(filter-out $(NO_DEP_TARGETS),$(MAKECMDGOALS))),)
  206. NEED_DEPS := 1
  207. endif
  208. ###############################################################################
  209. #
  210. # Select build architecture and platform based on $(BIN)
  211. #
  212. # BIN has the form bin[-[arch-]platform]
  213. ARCHS := $(patsubst arch/%,%,$(wildcard arch/*))
  214. PLATFORMS := $(patsubst config/defaults/%.h,%,\
  215. $(wildcard config/defaults/*.h))
  216. archs :
  217. @$(ECHO) $(ARCHS)
  218. platforms :
  219. @$(ECHO) $(PLATFORMS)
  220. ifdef BIN
  221. # Determine architecture portion of $(BIN), if present
  222. BIN_ARCH := $(strip $(foreach A,$(ARCHS),\
  223. $(patsubst bin-$(A)-%,$(A),\
  224. $(filter bin-$(A)-%,$(BIN)))))
  225. # Determine platform portion of $(BIN), if present
  226. ifeq ($(BIN_ARCH),)
  227. BIN_PLATFORM := $(patsubst bin-%,%,$(filter bin-%,$(BIN)))
  228. else
  229. BIN_PLATFORM := $(patsubst bin-$(BIN_ARCH)-%,%,$(BIN))
  230. endif
  231. # Determine build architecture
  232. DEFAULT_ARCH := i386
  233. ARCH := $(firstword $(BIN_ARCH) $(DEFAULT_ARCH))
  234. CFLAGS += -DARCH=$(ARCH)
  235. arch :
  236. @$(ECHO) $(ARCH)
  237. .PHONY : arch
  238. # Determine build platform
  239. DEFAULT_PLATFORM := pcbios
  240. PLATFORM := $(firstword $(BIN_PLATFORM) $(DEFAULT_PLATFORM))
  241. CFLAGS += -DPLATFORM=$(PLATFORM)
  242. platform :
  243. @$(ECHO) $(PLATFORM)
  244. endif # defined(BIN)
  245. # Include architecture-specific Makefile
  246. ifdef ARCH
  247. MAKEDEPS += arch/$(ARCH)/Makefile
  248. include arch/$(ARCH)/Makefile
  249. endif
  250. # Include architecture-specific include path
  251. ifdef ARCH
  252. INCDIRS += arch/$(ARCH)/include
  253. endif
  254. ###############################################################################
  255. #
  256. # Source file handling
  257. # SRCDIRS lists all directories containing source files.
  258. srcdirs :
  259. @$(ECHO) $(SRCDIRS)
  260. # SRCS lists all .c or .S files found in any SRCDIR
  261. #
  262. SRCS += $(wildcard $(patsubst %,%/*.c,$(SRCDIRS)))
  263. SRCS += $(wildcard $(patsubst %,%/*.S,$(SRCDIRS)))
  264. srcs :
  265. @$(ECHO) $(SRCS)
  266. # AUTO_SRCS lists all files in SRCS that are not mentioned in
  267. # NON_AUTO_SRCS. Files should be added to NON_AUTO_SRCS if they
  268. # cannot be built using the standard build template.
  269. #
  270. AUTO_SRCS = $(filter-out $(NON_AUTO_SRCS),$(SRCS))
  271. autosrcs :
  272. @$(ECHO) $(AUTO_SRCS)
  273. # Just about everything else in this section depends upon having
  274. # $(BIN) set
  275. ifdef BIN
  276. # INCDIRS lists the include path
  277. incdirs :
  278. @$(ECHO) $(INCDIRS)
  279. # Common flags
  280. #
  281. CFLAGS += $(foreach INC,$(INCDIRS),-I$(INC))
  282. CFLAGS += -Os
  283. CFLAGS += -g
  284. ifeq ($(CCTYPE),gcc)
  285. CFLAGS += -ffreestanding
  286. CFLAGS += -Wall -W -Wformat-nonliteral
  287. endif
  288. ifeq ($(CCTYPE),icc)
  289. CFLAGS += -fno-builtin
  290. CFLAGS += -no-ip
  291. CFLAGS += -no-gcc
  292. CFLAGS += -diag-disable 111 # Unreachable code
  293. CFLAGS += -diag-disable 128 # Unreachable loop
  294. CFLAGS += -diag-disable 170 # Array boundary checks
  295. CFLAGS += -diag-disable 177 # Unused functions
  296. CFLAGS += -diag-disable 181 # printf() format checks
  297. CFLAGS += -diag-disable 188 # enum strictness
  298. CFLAGS += -diag-disable 193 # Undefined preprocessor identifiers
  299. CFLAGS += -diag-disable 280 # switch ( constant )
  300. CFLAGS += -diag-disable 310 # K&R parameter lists
  301. CFLAGS += -diag-disable 424 # Extra semicolon
  302. CFLAGS += -diag-disable 589 # Declarations mid-code
  303. CFLAGS += -diag-disable 593 # Unused variables
  304. CFLAGS += -diag-disable 810 # Casting ints to smaller ints
  305. CFLAGS += -diag-disable 981 # Sequence point violations
  306. CFLAGS += -diag-disable 1292 # Ignored attributes
  307. CFLAGS += -diag-disable 1338 # void pointer arithmetic
  308. CFLAGS += -diag-disable 1361 # Variable-length arrays
  309. CFLAGS += -diag-disable 1418 # Missing prototypes
  310. CFLAGS += -diag-disable 1419 # Missing prototypes
  311. CFLAGS += -diag-disable 1599 # Hidden variables
  312. CFLAGS += -Wall -Wmissing-declarations
  313. endif
  314. CFLAGS += $(EXTRA_CFLAGS)
  315. ASFLAGS += $(EXTRA_ASFLAGS)
  316. LDFLAGS += $(EXTRA_LDFLAGS)
  317. # Inhibit -Werror if NO_WERROR is specified on make command line
  318. #
  319. ifneq ($(NO_WERROR),1)
  320. CFLAGS += -Werror
  321. ASFLAGS += --fatal-warnings
  322. endif
  323. # Function trace recorder state in the last build. This is needed
  324. # in order to correctly rebuild whenever the function recorder is
  325. # enabled/disabled.
  326. #
  327. FNREC_STATE := $(BIN)/.fnrec.state
  328. ifeq ($(wildcard $(FNREC_STATE)),)
  329. FNREC_STATE_OLD := <invalid>
  330. else
  331. FNREC_STATE_OLD := $(shell cat $(FNREC_STATE))
  332. endif
  333. ifeq ($(FNREC_STATE_OLD),$(FNREC))
  334. $(FNREC_STATE) :
  335. else
  336. $(FNREC_STATE) : clean
  337. $(shell $(ECHO) "$(FNREC)" > $(FNREC_STATE))
  338. endif
  339. VERYCLEANUP += $(FNREC_STATE)
  340. MAKEDEPS += $(FNREC_STATE)
  341. ifeq ($(FNREC),1)
  342. # Enabling -finstrument-functions affects gcc's analysis and leads to spurious
  343. # warnings about use of uninitialised variables.
  344. #
  345. CFLAGS += -Wno-uninitialized
  346. CFLAGS += -finstrument-functions
  347. CFLAGS += -finstrument-functions-exclude-file-list=core/fnrec.c
  348. endif
  349. # compiler.h is needed for our linking and debugging system
  350. #
  351. CFLAGS += -include compiler.h
  352. # CFLAGS for specific object types
  353. #
  354. CFLAGS_c +=
  355. CFLAGS_S += -DASSEMBLY
  356. # Base object name of the current target
  357. #
  358. OBJECT = $(firstword $(subst ., ,$(@F)))
  359. # CFLAGS for specific object files. You can define
  360. # e.g. CFLAGS_rtl8139, and have those flags automatically used when
  361. # compiling bin/rtl8139.o.
  362. #
  363. OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
  364. $(BIN)/%.flags :
  365. @$(ECHO) $(OBJ_CFLAGS)
  366. # ICC requires postprocessing objects to fix up table alignments
  367. #
  368. ifeq ($(CCTYPE),icc)
  369. POST_O = && $(ICCFIX) $@
  370. POST_O_DEPS := $(ICCFIX)
  371. else
  372. POST_O :=
  373. POST_O_DEPS :=
  374. endif
  375. # Rules for specific object types.
  376. #
  377. COMPILE_c = $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
  378. RULE_c = $(Q)$(COMPILE_c) -c $< -o $@ $(POST_O)
  379. RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -Ddebug_$(subst -,_,$(OBJECT))=$* -c $< -o $@ $(POST_O)
  380. RULE_c_to_c = $(Q)$(COMPILE_c) -E -c $< > $@
  381. RULE_c_to_s = $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
  382. PREPROCESS_S = $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
  383. ASSEMBLE_S = $(AS) $(ASFLAGS)
  384. RULE_S = $(Q)$(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
  385. RULE_S_to_s = $(Q)$(PREPROCESS_S) $< > $@
  386. DEBUG_TARGETS += dbg%.o c s
  387. # We automatically generate rules for any file mentioned in AUTO_SRCS
  388. # using the following set of templates. It would be cleaner to use
  389. # $(eval ...), but this function exists only in GNU make >= 3.80.
  390. # src_template : generate Makefile rules for a given source file
  391. #
  392. # $(1) is the full path to the source file (e.g. "drivers/net/rtl8139.c")
  393. # $(2) is the full path to the .d file (e.g. "bin/deps/drivers/net/rtl8139.d")
  394. # $(3) is the source type (e.g. "c")
  395. # $(4) is the source base name (e.g. "rtl8139")
  396. #
  397. define src_template
  398. @$(ECHO) " [DEPS] $(1)"
  399. @$(MKDIR) -p $(dir $(2))
  400. @$(RM) $(2)
  401. @$(TOUCH) $(2)
  402. @$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) -DOBJECT=$(4) \
  403. -Wno-error -M $(1) -MG -MP | \
  404. sed 's/\.o\s*:/_DEPS =/' >> $(2)
  405. @$(ECHO_E) '\n$$(BIN)/$(4).o :' \
  406. '$(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(4)_DEPS)' \
  407. '\n\t$$(QM)$(ECHO) " [BUILD] $$@"' \
  408. '\n\t$$(RULE_$(3))\n' \
  409. '\nBOBJS += $$(BIN)/$(4).o\n' \
  410. $(foreach TGT,$(DEBUG_TARGETS), \
  411. $(if $(RULE_$(3)_to_$(TGT)), \
  412. '\n$$(BIN)/$(4).$(TGT) :' \
  413. '$(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(4)_DEPS)' \
  414. '\n\t$$(QM)$(ECHO) " [BUILD] $$@"' \
  415. '\n\t$$(RULE_$(3)_to_$(TGT))\n' \
  416. '\n$(TGT)_OBJS += $$(BIN)/$(4).$(TGT)\n' ) ) \
  417. '\n$(2) : $$($(4)_DEPS)\n' \
  418. '\nTAGS : $$($(4)_DEPS)\n' \
  419. >> $(2)
  420. @$(PARSEROM) $(1) >> $(2)
  421. endef
  422. # Rule to generate the Makefile rules files to be included
  423. #
  424. $(BIN)/deps/%.d : % $(MAKEDEPS) $(PARSEROM)
  425. $(if $(filter $(AUTO_SRCS),$<),$(call src_template,$<,$@,$(subst .,,$(suffix $<)),$(basename $(notdir $<))),@$(ECHO) 'ERROR: $< is not an AUTO_SRC' ; exit 1)
  426. # Calculate and include the list of Makefile rules files
  427. #
  428. AUTO_DEPS = $(patsubst %,$(BIN)/deps/%.d,$(AUTO_SRCS))
  429. ifdef NEED_DEPS
  430. ifneq ($(AUTO_DEPS),)
  431. -include $(AUTO_DEPS)
  432. endif
  433. endif
  434. autodeps :
  435. @$(ECHO) $(AUTO_DEPS)
  436. VERYCLEANUP += $(BIN)/deps
  437. # The following variables are created by the Makefile rules files
  438. #
  439. bobjs :
  440. @$(ECHO) $(BOBJS)
  441. drivers :
  442. @$(ECHO) $(DRIVERS)
  443. .PHONY : drivers
  444. roms :
  445. @$(ECHO) $(ROMS)
  446. # List of embedded images included in the last build of embedded.o.
  447. # This is needed in order to correctly rebuild embedded.o whenever the
  448. # list of objects changes.
  449. #
  450. EMBEDDED_LIST := $(BIN)/.embedded.list
  451. ifeq ($(wildcard $(EMBEDDED_LIST)),)
  452. EMBEDDED_LIST_IMAGE := <invalid>
  453. else
  454. EMBEDDED_LIST_IMAGE := $(shell cat $(EMBEDDED_LIST))
  455. endif
  456. ifneq ($(EMBEDDED_LIST_IMAGE),$(EMBEDDED_IMAGE))
  457. $(shell $(ECHO) "$(EMBEDDED_IMAGE)" > $(EMBEDDED_LIST))
  458. endif
  459. $(EMBEDDED_LIST) :
  460. VERYCLEANUP += $(EMBEDDED_LIST)
  461. EMBEDDED_FILES := $(subst $(COMMA), ,$(EMBEDDED_IMAGE))
  462. EMBED_ALL := $(foreach i,$(call seq,1,$(words $(EMBEDDED_FILES))),\
  463. EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\
  464. \"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))
  465. $(BIN)/embedded.o : $(EMBEDDED_FILES) $(EMBEDDED_LIST)
  466. # This file uses .incbin inline assembly to include a binary file.
  467. # Unfortunately ccache does not detect this dependency and caches builds even
  468. # when the binary file has changed.
  469. #
  470. $(BIN)/embedded.o : override CC := env CCACHE_DISABLE=1 $(CC)
  471. CFLAGS_embedded = -DEMBED_ALL="$(EMBED_ALL)"
  472. # Generate the NIC file from the parsed source files. The NIC file is
  473. # only for rom-o-matic.
  474. #
  475. $(BIN)/NIC : $(AUTO_DEPS)
  476. @$(ECHO) '# This is an automatically generated file, do not edit' > $@
  477. @$(ECHO) '# It does not affect anything in the build, ' \
  478. 'it is only for rom-o-matic' >> $@
  479. @$(ECHO) >> $@
  480. @perl -ne 'chomp; print "$$1\n" if /\# NIC\t(.*)$$/' $^ >> $@
  481. CLEANUP += $(BIN)/NIC # Doesn't match the $(BIN)/*.* pattern
  482. # Analyse a target name (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and
  483. # derive the variables:
  484. #
  485. # TGT_ELEMENTS : the elements of the target (e.g. "dfe538 prism2_pci")
  486. # TGT_PREFIX : the prefix type (e.g. "zrom")
  487. # TGT_DRIVERS : the driver for each element (e.g. "rtl8139 prism2_pci")
  488. # TGT_ROM_NAME : the ROM name (e.g. "dfe538")
  489. # TGT_MEDIA : the media type (e.g. "rom")
  490. #
  491. DRIVERS_ipxe = $(DRIVERS)
  492. CARD_DRIVER = $(firstword $(DRIVER_$(1)) $(1))
  493. TGT_ELEMENTS = $(subst --, ,$(firstword $(subst ., ,$(notdir $@))))
  494. TGT_PREFIX = $(word 2,$(subst ., ,$(notdir $@)))
  495. TGT_ROM_NAME = $(firstword $(TGT_ELEMENTS))
  496. TGT_DRIVERS = $(strip $(if $(DRIVERS_$(TGT_ROM_NAME)), \
  497. $(DRIVERS_$(TGT_ROM_NAME)), \
  498. $(foreach TGT_ELEMENT,$(TGT_ELEMENTS), \
  499. $(call CARD_DRIVER,$(TGT_ELEMENT))) ))
  500. TGT_MEDIA = $(subst z,,$(TGT_PREFIX))
  501. # Look up ROM IDs for the current target
  502. # (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the variables:
  503. #
  504. # TGT_PCI_VENDOR : the PCI vendor ID (e.g. "0x1186")
  505. # TGT_PCI_DEVICE : the PCI device ID (e.g. "0x1300")
  506. #
  507. TGT_PCI_VENDOR = $(PCI_VENDOR_$(TGT_ROM_NAME))
  508. TGT_PCI_DEVICE = $(PCI_DEVICE_$(TGT_ROM_NAME))
  509. # Calculate link-time options for the current target
  510. # (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the variables:
  511. #
  512. # TGT_LD_DRIVERS : symbols to require in order to drag in the relevant drivers
  513. # (e.g. "obj_rtl8139 obj_prism2_pci")
  514. # TGT_LD_IDS : symbols to define in order to fill in ID structures in the
  515. # ROM header (e.g."pci_vendor_id=0x1186 pci_device_id=0x1300")
  516. #
  517. TGT_LD_DRIVERS = $(subst -,_,$(patsubst %,obj_%,$(TGT_DRIVERS)))
  518. TGT_LD_PREFIX = obj_$(TGT_PREFIX)prefix
  519. TGT_LD_IDS = pci_vendor_id=$(firstword $(TGT_PCI_VENDOR) 0) \
  520. pci_device_id=$(firstword $(TGT_PCI_DEVICE) 0)
  521. # Calculate linker flags based on link-time options for the current
  522. # target type (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the
  523. # variables:
  524. #
  525. # TGT_LD_FLAGS : target-specific flags to pass to linker (e.g.
  526. # "-u obj_zpciprefix -u obj_rtl8139 -u obj_prism2_pci
  527. # --defsym pci_vendor=0x1186 --defsym pci_device=0x1300")
  528. #
  529. TGT_LD_FLAGS = $(foreach SYM,$(TGT_LD_PREFIX) $(TGT_LD_DRIVERS) obj_config,\
  530. -u $(SYM) --defsym check_$(SYM)=$(SYM) ) \
  531. $(patsubst %,--defsym %,$(TGT_LD_IDS)) \
  532. $(TGT_LD_FLAGS_PRE)
  533. # Calculate list of debugging versions of objects to be included in
  534. # the target.
  535. #
  536. DEBUG_LIST = $(subst $(COMMA), ,$(DEBUG))
  537. DEBUG_OBJ_LEVEL = $(firstword $(word 2,$(subst :, ,$(1))) 1)
  538. DEBUG_OBJ_BASE = $(word 1,$(subst :, ,$(1))).dbg$(call DEBUG_OBJ_LEVEL,$(1))
  539. DEBUG_OBJ = $(BIN)/$(call DEBUG_OBJ_BASE,$(1)).o
  540. DEBUG_ORIG_OBJ = $(BIN)/$(word 1,$(subst :, ,$(1))).o
  541. DEBUG_OBJS = $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ,$(D)))
  542. DEBUG_ORIG_OBJS = $(foreach D,$(DEBUG_LIST),$(call DEBUG_ORIG_OBJ,$(D)))
  543. BLIB_OBJS = $(DEBUG_OBJS) $(filter-out $(DEBUG_ORIG_OBJS),$(BOBJS))
  544. # Print out all derived information for a given target.
  545. #
  546. $(BIN)/%.info :
  547. @$(ECHO) 'Elements : $(TGT_ELEMENTS)'
  548. @$(ECHO) 'Prefix : $(TGT_PREFIX)'
  549. @$(ECHO) 'Drivers : $(TGT_DRIVERS)'
  550. @$(ECHO) 'ROM name : $(TGT_ROM_NAME)'
  551. @$(ECHO) 'Media : $(TGT_MEDIA)'
  552. @$(ECHO)
  553. @$(ECHO) 'PCI vendor : $(TGT_PCI_VENDOR)'
  554. @$(ECHO) 'PCI device : $(TGT_PCI_DEVICE)'
  555. @$(ECHO)
  556. @$(ECHO) 'LD driver symbols : $(TGT_LD_DRIVERS)'
  557. @$(ECHO) 'LD prefix symbols : $(TGT_LD_PREFIX)'
  558. @$(ECHO) 'LD ID symbols : $(TGT_LD_IDS)'
  559. @$(ECHO)
  560. @$(ECHO) 'LD target flags : $(TGT_LD_FLAGS)'
  561. @$(ECHO)
  562. @$(ECHO) 'Debugging objects : $(DEBUG_OBJS)'
  563. @$(ECHO) 'Replaced objects : $(DEBUG_ORIG_OBJS)'
  564. # List of objects included in the last build of blib. This is needed
  565. # in order to correctly rebuild blib whenever the list of objects
  566. # changes.
  567. #
  568. BLIB_LIST := $(BIN)/.blib.list
  569. ifeq ($(wildcard $(BLIB_LIST)),)
  570. BLIB_LIST_OBJS := <invalid>
  571. else
  572. BLIB_LIST_OBJS := $(shell cat $(BLIB_LIST))
  573. endif
  574. ifneq ($(BLIB_LIST_OBJS),$(BLIB_OBJS))
  575. $(shell $(ECHO) "$(BLIB_OBJS)" > $(BLIB_LIST))
  576. endif
  577. $(BLIB_LIST) :
  578. VERYCLEANUP += $(BLIB_LIST)
  579. # Library of all objects
  580. #
  581. BLIB = $(BIN)/blib.a
  582. $(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS)
  583. $(Q)$(RM) $(BLIB)
  584. $(QM)$(ECHO) " [AR] $@"
  585. $(Q)$(AR) r $@ $(BLIB_OBJS)
  586. $(Q)$(RANLIB) $@
  587. blib : $(BLIB)
  588. # Command to generate build ID. Must be unique for each $(BIN)/%.tmp,
  589. # even within the same build run.
  590. #
  591. BUILD_ID_CMD := perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'
  592. # Build an intermediate object file from the objects required for the
  593. # specified target.
  594. #
  595. $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
  596. $(QM)$(ECHO) " [LD] $@"
  597. $(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $(BLIB) -o $@ \
  598. --defsym _build_id=`$(BUILD_ID_CMD)` -Map $(BIN)/$*.tmp.map
  599. $(Q)$(OBJDUMP) -ht $@ | $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
  600. # Keep intermediate object file (useful for debugging)
  601. .PRECIOUS : $(BIN)/%.tmp
  602. # Show a linker map for the specified target
  603. #
  604. $(BIN)/%.map : $(BIN)/%.tmp
  605. @less $(BIN)/$*.tmp.map
  606. # Get objects list for the specified target
  607. #
  608. define objs_list
  609. $(sort $(foreach OBJ_SYMBOL,\
  610. $(filter obj_%,$(shell $(NM) $(1) | cut -d" " -f3)),\
  611. $(patsubst obj_%,%,$(OBJ_SYMBOL))))
  612. endef
  613. $(BIN)/%.objs : $(BIN)/%.tmp
  614. $(Q)$(ECHO) $(call objs_list,$<)
  615. $(BIN)/%.sizes : $(BIN)/%.tmp
  616. $(Q)$(SIZE) -t $(foreach OBJ,$(call objs_list,$<),$(wildcard $(BIN)/$(subst _,?,$(OBJ)).o)) | \
  617. sort -g
  618. # Get dependency list for the specified target
  619. #
  620. define deps_list
  621. $(sort $(foreach OBJ,$(call objs_list,$(1)),$($(OBJ)_DEPS)))
  622. endef
  623. $(BIN)/%.deps : $(BIN)/%.tmp
  624. $(Q)$(ECHO) $(call deps_list,$<)
  625. # Get unneeded source files for the specified target
  626. #
  627. define nodeps_list
  628. $(sort $(filter-out $(call deps_list,$(1)),\
  629. $(foreach BOBJ,$(BOBJS),\
  630. $($(basename $(notdir $(BOBJ)))_DEPS))))
  631. endef
  632. $(BIN)/%.nodeps : $(BIN)/%.tmp
  633. $(Q)$(ECHO) $(call nodeps_list,$<)
  634. # Get licensing verdict for the specified target
  635. #
  636. define unlicensed_deps_list
  637. $(shell grep -L FILE_LICENCE $(call deps_list,$(1)))
  638. endef
  639. define licence_list
  640. $(patsubst __licence_%,%,\
  641. $(filter __licence_%,$(shell $(NM) $(1) | cut -d" " -f3)))
  642. endef
  643. $(BIN)/%.licence : $(BIN)/%.tmp
  644. $(QM)$(ECHO) " [LICENCE] $@"
  645. $(Q)$(if $(strip $(call unlicensed_deps_list,$<)),\
  646. echo -n "Unable to determine licence because the following " ;\
  647. echo "files are missing a licence declaration:" ;\
  648. echo $(call unlicensed_deps_list,$<);\
  649. exit 1,\
  650. $(LICENCE) $(call licence_list,$<))
  651. # Extract compression information from intermediate object file
  652. #
  653. $(BIN)/%.zinfo : $(BIN)/%.tmp
  654. $(QM)$(ECHO) " [ZINFO] $@"
  655. $(Q)$(OBJCOPY) -O binary -j .zinfo $< $@
  656. # Build raw binary file from intermediate object file
  657. #
  658. $(BIN)/%.bin : $(BIN)/%.tmp
  659. $(QM)$(ECHO) " [BIN] $@"
  660. $(Q)$(OBJCOPY) -O binary -R .zinfo $< $@
  661. # Compress raw binary file
  662. #
  663. $(BIN)/%.zbin : $(BIN)/%.bin $(BIN)/%.zinfo $(ZBIN)
  664. $(QM)$(ECHO) " [ZBIN] $@"
  665. $(Q)$(ZBIN) $(BIN)/$*.bin $(BIN)/$*.zinfo > $@
  666. # Rules for each media format. These are generated and placed in an
  667. # external Makefile fragment. We could do this via $(eval ...), but
  668. # that would require make >= 3.80.
  669. #
  670. # Note that there's an alternative way to generate most .rom images:
  671. # they can be copied from their 'master' ROM image using cp and
  672. # reprocessed with makerom to add the PCI IDs and ident string. The
  673. # relevant rule would look something like:
  674. #
  675. # $(BIN)/dfe538%rom : $(BIN)/rtl8139%rom
  676. # cat $< $@
  677. # $(FINALISE_rom)
  678. #
  679. # You can derive the ROM/driver relationships using the variables
  680. # DRIVER_<rom> and/or ROMS_<driver>.
  681. #
  682. # We don't currently do this, because (a) it would require generating
  683. # yet more Makefile fragments (since you need a rule for each ROM in
  684. # ROMS), and (b) the linker is so fast that it probably wouldn't make
  685. # much difference to the overall build time.
  686. media :
  687. @$(ECHO) $(MEDIA)
  688. AUTO_MEDIA = $(filter-out $(NON_AUTO_MEDIA),$(MEDIA))
  689. automedia :
  690. @$(ECHO) $(AUTO_MEDIA)
  691. # media_template : create Makefile rules for specified media
  692. #
  693. # $(1) is the media name (e.g. "rom")
  694. # $(2) is the full path to the .d file (e.g. "bin/deps/rom.media.d")
  695. #
  696. define media_template
  697. @$(ECHO) " [MEDIADEPS] $(1)"
  698. @$(MKDIR) -p $(dir $(2))
  699. @$(RM) $(2)
  700. @$(TOUCH) $(2)
  701. @$(ECHO_E) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
  702. '\n\t$$(QM)$(ECHO) " [FINISH] $$@"' \
  703. '\n\t$$(Q)$$(CP) $$< $$@' \
  704. '\n\t$$(Q)$$(PAD_$(1))' \
  705. '\n\t$$(Q)$$(FINALISE_$(1))' \
  706. > $(2)
  707. endef
  708. # Rule to generate the Makefile rules to be included
  709. #
  710. $(BIN)/deps/%.media.d : $(MAKEDEPS)
  711. $(if $(filter $(AUTO_MEDIA),$*), \
  712. $(call media_template,$*,$@), \
  713. @$(ECHO) 'ERROR: $* is not an AUTO_MEDIA' ; exit 1)
  714. # Calculate and include the list of Makefile rules files
  715. #
  716. MEDIA_DEPS = $(patsubst %,$(BIN)/deps/%.media.d,$(AUTO_MEDIA))
  717. mediadeps :
  718. @$(ECHO) $(MEDIA_DEPS)
  719. ifdef NEED_DEPS
  720. ifneq ($(MEDIA_DEPS),)
  721. -include $(MEDIA_DEPS)
  722. endif
  723. endif
  724. # Wrap up binary blobs (for embedded images)
  725. #
  726. $(BIN)/%.o : payload/%.img
  727. $(QM)echo " [WRAP] $@"
  728. $(Q)$(LD) -b binary -r -o $@ $< --undefined obj_payload \
  729. --defsym obj_$*=0
  730. BOBJS += $(patsubst payload/%.img,$(BIN)/%.o,$(wildcard payload/*.img))
  731. # The "allXXXs" targets for each suffix
  732. #
  733. allall: allroms allzroms allpxes allisos alldsks
  734. allroms allzroms : all%s : $(foreach ROM,$(ROMS),$(BIN)/$(ROM).%)
  735. allpxes allisos alldsks : all%s : $(foreach DRIVER,$(DRIVERS),$(BIN)/$(DRIVER).%)
  736. # Alias for ipxe.%
  737. #
  738. $(BIN)/etherboot.% : $(BIN)/ipxe.%
  739. ln -sf $(notdir $<) $@
  740. endif # defined(BIN)
  741. ###############################################################################
  742. #
  743. # The compression utilities
  744. #
  745. $(NRV2B) : util/nrv2b.c $(MAKEDEPS)
  746. $(QM)$(ECHO) " [HOSTCC] $@"
  747. $(Q)$(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG \
  748. -DBITSIZE=32 -DENDIAN=0 -o $@ $<
  749. CLEANUP += $(NRV2B)
  750. $(ZBIN) : util/zbin.c util/nrv2b.c $(MAKEDEPS)
  751. $(QM)$(ECHO) " [HOSTCC] $@"
  752. $(Q)$(HOST_CC) -O2 -o $@ $<
  753. CLEANUP += $(ZBIN)
  754. ###############################################################################
  755. #
  756. # The EFI image converter
  757. #
  758. ELF2EFI_CFLAGS := -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \
  759. -I$(ZLIB_DIR)/include -idirafter include \
  760. -L$(BINUTILS_DIR)/lib -L$(BFD_DIR)/lib -L$(ZLIB_DIR)/lib \
  761. -lbfd -liberty -lz -Wl,--no-warn-search-mismatch
  762. $(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
  763. $(QM)$(ECHO) " [HOSTCC] $@"
  764. $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DMDE_CPU_IA32 -O2 -o $@
  765. CLEANUP += $(ELF2EFI32)
  766. $(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
  767. $(QM)$(ECHO) " [HOSTCC] $@"
  768. $(Q)$(HOST_CC) $< $(ELF2EFI_CFLAGS) -DMDE_CPU_X64 -O2 -o $@
  769. CLEANUP += $(ELF2EFI64)
  770. $(EFIROM) : util/efirom.c $(MAKEDEPS)
  771. $(QM)$(ECHO) " [HOSTCC] $@"
  772. $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
  773. CLEANUP += $(EFIROM)
  774. ###############################################################################
  775. #
  776. # The ICC fixup utility
  777. #
  778. $(ICCFIX) : util/iccfix.c $(MAKEDEPS)
  779. $(QM)$(ECHO) " [HOSTCC] $@"
  780. $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
  781. CLEANUP += $(ICCFIX)
  782. ###############################################################################
  783. #
  784. # Local configs
  785. #
  786. config/local/%.h :
  787. $(Q)touch $@
  788. ###############################################################################
  789. #
  790. # Auto-incrementing build serial number. Append "bs" to your list of
  791. # build targets to get a serial number printed at the end of the
  792. # build. Enable -DBUILD_SERIAL in order to see it when the code runs.
  793. #
  794. BUILDSERIAL_H = config/.buildserial.h
  795. BUILDSERIAL_NOW = config/.buildserial.now
  796. BUILDSERIAL_NEXT = config/.buildserial.next
  797. $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) :
  798. $(ECHO) 1 > $@
  799. $(BUILDSERIAL_H) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT)
  800. $(ECHO) '#define BUILD_SERIAL_NUM $(shell cat $<)' > $@
  801. ifeq ($(filter bs,$(MAKECMDGOALS)),bs)
  802. $(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \
  803. cp -f $(BUILDSERIAL_NEXT) $(BUILDSERIAL_NOW))
  804. endif
  805. bs : $(BUILDSERIAL_NOW)
  806. @$(ECHO) $$(( $(shell cat $<) + 1 )) > $(BUILDSERIAL_NEXT)
  807. @$(ECHO) "Build serial number is $(shell cat $<)"
  808. ###############################################################################
  809. #
  810. # Build the TAGS file(s) for emacs
  811. #
  812. TAGS :
  813. ctags -e -R -f $@ --exclude=bin
  814. CLEANUP += TAGS
  815. ###############################################################################
  816. #
  817. # Force rebuild for any given target
  818. #
  819. %.rebuild :
  820. rm -f $*
  821. $(Q)$(MAKE) $*
  822. ###############################################################################
  823. #
  824. # Symbol table checks
  825. #
  826. ifdef BIN
  827. SYMTAB = $(BIN)/symtab
  828. $(SYMTAB) : $(BLIB)
  829. $(OBJDUMP) -w -t $< > $@
  830. CLEANUP += $(BIN)/symtab
  831. symcheck : $(SYMTAB)
  832. $(SYMCHECK) $<
  833. endif # defined(BIN)
  834. ###############################################################################
  835. #
  836. # Build bochs symbol table
  837. #
  838. ifdef BIN
  839. $(BIN)/%.bxs : $(BIN)/%.tmp
  840. $(NM) $< | cut -d" " -f1,3 > $@
  841. endif # defined(BIN)
  842. ###############################################################################
  843. #
  844. # Documentation
  845. #
  846. ifdef BIN
  847. $(BIN)/doxygen.cfg : doxygen.cfg $(MAKEDEPS)
  848. $(Q)$(PERL) -pe 's{\@SRCDIRS\@}{$(SRCDIRS)}; ' \
  849. -e 's{\@INCDIRS\@}{$(filter-out .,$(INCDIRS))}; ' \
  850. -e 's{\@BIN\@}{$(BIN)}; ' \
  851. -e 's{\@ARCH\@}{$(ARCH)}; ' \
  852. $< > $@
  853. $(BIN)/doc : $(BIN)/doxygen.cfg
  854. $(Q)$(DOXYGEN) $<
  855. .PHONY : $(BIN)/doc
  856. doc : $(BIN)/doc
  857. doc-clean :
  858. $(Q)$(RM) -r $(BIN)/doc
  859. VERYCLEANUP += $(BIN)/doc
  860. docview :
  861. @[ -f $(BIN)/doc/html/index.html ] || $(MAKE) $(BIN)/doc
  862. @if [ -n "$$BROWSER" ] ; then \
  863. ( $$BROWSER $(BIN)/doc/html/index.html & ) ; \
  864. else \
  865. $(ECHO) "Documentation index in $(BIN)/doc/html/index.html" ; \
  866. fi
  867. endif # defined(BIN)
  868. ###############################################################################
  869. #
  870. # Clean-up
  871. #
  872. clean :
  873. $(RM) $(CLEANUP)
  874. veryclean : clean
  875. $(RM) -r $(VERYCLEANUP)