11.5Suebayasio Call module as module.
21.5Suebayasi
31.5Suebayasi  Until now, everything is called as attribute.  Separate module from it:
41.5Suebayasi
51.5Suebayasi	- Module is a collection of code (*.[cSo]), and provides a function.
61.5Suebayasi	  Module can depend on other modules.
71.5Suebayasi
81.5Suebayasi	- Attribute provides metadata for modules.  One module can have
91.5Suebayasi	  multiple attributes.  Attribute doesn't generate a module (*.o,
101.5Suebayasi	  *.ko).
111.5Suebayasi
121.1Suebayasio Emit everything (ioconf.*, Makefile, ...) per-attribute.
131.1Suebayasi
141.9Suebayasi  config(9) related metadata (cfdriver, cfattach, cfdata, ...) should be
151.9Suebayasi  collected using linker.  Create ELF sections like
161.9Suebayasi  .{rodata,data}.config.{cfdriver,cfattach,cfdata}.  Provide reference
171.9Suebayasi  symbols (e.g. cfdriverinit[]) using linker script.  Sort entries by name
181.9Suebayasi  to lookup entries by binary search in kernel.
191.9Suebayasi
201.1Suebayasio Generate modular(9) related information.  Especially module dependency.
211.1Suebayasi
221.9Suebayasi  At this moment modular(9) modules hardcode dependency in *.c using the
231.9Suebayasi  MODULE() macro:
241.9Suebayasi
251.9Suebayasi	MODULE(MODULE_CLASS_DRIVER, hdaudio, "pci");
261.9Suebayasi
271.9Suebayasi  This information already exists in config(5) definitions (files.*).
281.9Suebayasi  Extend config(5) to be able to specify module's class.
291.9Suebayasi
301.9Suebayasi  Ideally these module metadata are kept somewhere in ELF headers, so that
311.9Suebayasi  loaders (e.g. boot(8)) can easily read.  One idea is to abuse DYNAMIC
321.9Suebayasi  sections to record dependency, as shared library does.  (Feasibility
331.9Suebayasi  unknown.)
341.9Suebayasi
351.1Suebayasio Rename "interface attribute" to "bus".
361.1Suebayasi
371.1Suebayasi  Instead of
381.1Suebayasi
391.1Suebayasi	define	audiobus {}
401.1Suebayasi	attach	audio at audiobus
411.1Suebayasi
421.1Suebayasi  Do like this
431.1Suebayasi
441.1Suebayasi	defbus	audiobus {}
451.1Suebayasi	attach	audio at audiobus
461.1Suebayasi
471.15Suebayasi  Always provide xxxbusprint() (and xxxbussubmatch if multiple children).
481.15Suebayasi  Extend struct cfiattrdata like:
491.15Suebayasi
501.15Suebayasi	struct cfiattrdata {
511.15Suebayasi		const char *ci_name;
521.15Suebayasi		cfprint_t ci_print;
531.15Suebayasi		cfsubmatch_t ci_submatch;
541.15Suebayasi		int ci_loclen;
551.15Suebayasi		const struct cflocdesc ci_locdesc[];
561.15Suebayasi	};
571.15Suebayasi
581.15Suebayasio Simplify child configuration API
591.15Suebayasi
601.15Suebayasi  With said struct cfiattrdata extension, config_found*() can omit
611.15Suebayasi  print/submatch args.  If the found child is known (e.g., "pcibus" creating
621.15Suebayasi  "pci"):
631.15Suebayasi
641.16Suebayasi	config_found(self, "pcibus");
651.15Suebayasi
661.15Suebayasi  If finding unknown children (e.g. "pci" finding pci devices):
671.15Suebayasi
681.15Suebayasi	config_find(self, "pci", locs, aux);
691.15Suebayasi
701.8Suebayasio Retire "attach foo at bar with foo_bar.c"
711.8Suebayasi
721.8Suebayasi  Most of these should be rewritten by defining a common interface attribute
731.8Suebayasi  "foobus", instead of writing multiple attachments.  com(4), ld(4), ehci(4)
741.8Suebayasi  are typical examples.  For ehci(4), EHCI-capable controller drivers implement
751.8Suebayasi  "ehcibus" interface, like:
761.8Suebayasi
771.33Sandvar	define	ehcibus {}
781.8Suebayasi	device	imxehci: ehcibus
791.8Suebayasi
801.8Suebayasi  These drivers' attach functions call config_found() to attach ehci(4) via
811.8Suebayasi  the "ehcibus" interface attribute, instead of calling ehci_init() directly.
821.8Suebayasi  Same for com(4) (com_attach_subr()) and ld(4) (ldattach()).
831.8Suebayasi
841.1Suebayasio Sort objects in more reasonable order.
851.1Suebayasi
861.1Suebayasi  Put machdep.ko in the lowest address.  uvm.ko and kern.ko follow.
871.1Suebayasi
881.1Suebayasi  Kill alphabetical sort (${OBJS:O} in sys/conf/Makefile.inc.kern.
891.1Suebayasi
901.1Suebayasi  Use ldscript.  Do like this
911.1Suebayasi
921.1Suebayasi	.text :
931.1Suebayasi	AT (ADDR(.text) & 0x0fffffff)
941.1Suebayasi	{
951.1Suebayasi	  *(.text.machdep.locore.entry)
961.1Suebayasi	  *(.text.machdep.locore)
971.1Suebayasi	  *(.text.machdep)
981.1Suebayasi	  *(.text)
991.1Suebayasi	  *(.text.*)
1001.1Suebayasi	  :
1011.1Suebayasi
1021.1Suebayasi  Kill linker definitions in sys/conf/Makefile.inc.kern.
1031.2Suebayasi
1041.3Swizo Differentiate "options" and "flags"/"params".
1051.2Suebayasi
1061.3Swiz  "options" enables features by adding *.c files (via attributes).
1071.2Suebayasi
1081.2Suebayasi  "flags" and "params" are to change contents of *.c files.  These don't add
1091.3Swiz  *.c files to the result kernel, or don't build attributes (modules).
1101.2Suebayasi
1111.2Suebayasio Make flags/params per attributes (modules).
1121.2Suebayasi
1131.2Suebayasi  Basically flags and params are cpp(1) #define's generated in opt_*.h.  Make
1141.2Suebayasi  them local to one attributes (modules).  Flags/params which affects files
1151.2Suebayasi  across attributes (modules) are possible, but should be discouraged.
1161.2Suebayasi
1171.2Suebayasio Generate things only by definitions.
1181.2Suebayasi
1191.2Suebayasi  In the ideal dynamically modular world, "selection" will be done not at
1201.2Suebayasi  compile time but at runtime.  Users select their wanted modules, by
1211.2Suebayasi  dynamically loading them.
1221.2Suebayasi
1231.2Suebayasi  This means that the system provides all choices; that is, build all modules
1241.2Suebayasi  in the source tree.  Necessary information is defined in the "definition"
1251.2Suebayasi  part.
1261.2Suebayasi
1271.2Suebayasio Split cfdata.
1281.2Suebayasi
1291.8Suebayasi  cfdata is a set of pattern matching rules to enable devices at runtime device
1301.3Swiz  auto-configuration.  It is pure data and can (should) be generated separately
1311.2Suebayasi  from the code.
1321.4Sapb
1331.4Sapbo Allow easier adding and removing of options.
1341.4Sapb
1351.4Sapb  It should be possible to add or remove options, flags, etc.,
1361.4Sapb  without regard to whether or not they are already defined.
1371.4Sapb  For example, a configuration like this:
1381.4Sapb
1391.4Sapb	include GENERIC
1401.4Sapb	options FOO
1411.4Sapb	no options BAR
1421.4Sapb
1431.4Sapb  should work regardless of whether or not options FOO and/or
1441.4Sapb  options BAR were defined in GENERIC.  It should not give
1451.4Sapb  errors like "options BAR was already defined" or "options FOO
1461.4Sapb  was not defined".
1471.4Sapb
1481.5Suebayasio Introduce "class".
1491.5Suebayasi
1501.7Swiz  Every module should be classified as at least one class, as modular(9)
1511.7Swiz  modules already do.  For example, file systems are marked as "vfs", network
1521.5Suebayasi  protocols are "netproto".
1531.5Suebayasi
1541.5Suebayasi  Consider to merge "devclass" into "class".
1551.5Suebayasi
1561.5Suebayasi  For syntax clarity, class names could be used as a keyword to select the
1571.5Suebayasi  class's instance module:
1581.5Suebayasi
1591.5Suebayasi	# Define net80211 module as netproto class
1601.5Suebayasi	class netproto
1611.5Suebayasi	define net80211: netproto
1621.5Suebayasi
1631.5Suebayasi	# Select net80211 to be builtin
1641.5Suebayasi	netproto net80211
1651.5Suebayasi
1661.5Suebayasi  Accordingly device/attach selection syntax should be revisited.
1671.5Suebayasi
1681.6Suebayasio Support kernel constructor/destructor (.kctors/.kdtors)
1691.5Suebayasi
1701.5Suebayasi  Initialization and finalization should be called via constructors and
1711.5Suebayasi  destructors.  Don't hardcode those sequences as sys/kern/init_main.c:main()
1721.5Suebayasi  does.
1731.5Suebayasi
1741.6Suebayasi  The order of .kctors/.kdtors is resolved by dependency.  The difference from
1751.5Suebayasi  userland is that in kernel depended ones are located in lower addresses;
1761.5Suebayasi  "machdep" module is the lowest.  Thus the lowest entry in .ctors must be
1771.5Suebayasi  executed the first.
1781.5Suebayasi
1791.6Suebayasi  The .kctors/.kdtors entries are executed by kernel's main() function, unlike
1801.6Suebayasi  userland where start code executes .ctors/.dtors before main().  The hardcoded
1811.6Suebayasi  sequence of various subsystem initializations in init_main.c:main() will be
1821.7Swiz  replaced by an array of .kctors invocations, and #ifdef's there will be gone.
1831.6Suebayasi
1841.12Suebayasio Hide link-set in the final kernel.
1851.5Suebayasi
1861.12Suebayasi  Link-set is used to collect references (pointers) at link time.  It relys on
1871.12Suebayasi  the ld(1) behavior that it automatically generates `__start_X' and `__stop_X'
1881.12Suebayasi  symbols for the section `X' to reduce coding.
1891.12Suebayasi
1901.12Suebayasi  Don't allow kernel subsystems create random ELF sections.
1911.12Suebayasi
1921.12Suebayasi  Pre-define all the available link-set names and pre-generate a linker script
1931.12Suebayasi  to merge them into .rodata.
1941.12Suebayasi
1951.12Suebayasi  (For modular(9) modules, `link_set_modules' is looked up by kernel loader.
1961.12Suebayasi  Provide only it.)
1971.12Suebayasi
1981.12Suebayasi  Provide a way for 3rd party modules to declare extra link-set.
1991.6Suebayasi
2001.6Suebayasio Shared kernel objects.
2011.6Suebayasi
2021.7Swiz  Since NetBSD has not established a clear kernel ABI, every single kernel
2031.6Suebayasi  has to build all the objects by their own.  As a result, similar kernels
2041.6Suebayasi  (e.g. evbarm kernels) repeatedly compile similar objects, that is waste of
2051.6Suebayasi  energy & space.
2061.6Suebayasi
2071.6Suebayasi  Share them if possible.  For evb* ports, ideally everything except machdep.ko
2081.6Suebayasi  should be shared.
2091.6Suebayasi
2101.6Suebayasi  While leaving optimizations as options (CPU specific optimizations, inlined
2111.6Suebayasi  bus_space(9) operations, etc.) for users, the official binaries build
2121.6Suebayasi  provided by TNF should be as portable as possible.
2131.10Suebayasi
2141.23Suebayasio Always use explicit kernel linker script.
2151.23Suebayasi
2161.23Suebayasi  ld(1) has an option -T <ldscript> to use a given linker script.  If not
2171.23Suebayasi  specified, a default, built-in linker script, mainly meant for userland
2181.23Suebayasi  programs, is used.
2191.23Suebayasi
2201.23Suebayasi  Currently m68k, sh3, and vax don't have kernel linker scripts.  These work
2211.23Suebayasi  because these have no constraints about page boundary; they map and access
2221.23Suebayasi  kernel .text/.data in the same way.
2231.23Suebayasi
2241.27Suebayasio Pass input files to ${LD} via linker script.
2251.27Suebayasi
2261.27Suebayasi  Instead of passing input files on command-line, output "INPUT(xxx.o)"
2271.27Suebayasi  commands, and include it from generated linker scripts.
2281.27Suebayasi
2291.31Suebayasio Directly generate `*.d' files.
2301.27Suebayasi
2311.27Suebayasi  Output source/object files in raw texts instead of `Makefile'.  Generate
2321.27Suebayasi  `*.d' (make(1) depend) files.  make(1) knows which object files are to be
2331.27Suebayasi  compiled.  With "INPUT(xxx.o)" linker scripts, either generated `Makefile'
2341.27Suebayasi  or `Makefile.kern.inc' don't need to keep source/object files in variables.
2351.27Suebayasi
2361.10Suebayasio Control ELF sections using linker script.
2371.10Suebayasi
2381.10Suebayasi  Now kernel is linked and built directly from object files (*.o).  Each port
2391.10Suebayasi  has an MD linker script, which does everything needed to be done at link
2401.10Suebayasi  time.  As a result, they do from MI alignment restriction (read_mostly,
2411.10Suebayasi  cacheline_aligned) to load address specification for external boot loaders.
2421.10Suebayasi
2431.10Suebayasi  Make this into multiple stages to make linkage more structural.  Especially,
2441.11Suebayasi  reserve the final link for purely MD purpose.  Note that in modular build,
2451.11Suebayasi  *.ko are shared between build of kernel and modular(9) modules (*.kmod).
2461.10Suebayasi
2471.10Suebayasi	Monolithic build:
2481.10Suebayasi		     *.o  ---> netbsd.ko	Generic MI linkage
2491.10Suebayasi		netbsd.ko ---> netbsd.ro	Kernel MI linkage
2501.10Suebayasi		netbsd.ro ---> netbsd		Kernel MD linkage
2511.10Suebayasi
2521.10Suebayasi	Modular build (kernel):
2531.10Suebayasi		     *.o  --->      *.ko	Generic + Per-module MI linkage
2541.10Suebayasi		     *.ko ---> netbsd.ro	Kernel MI linkage
2551.10Suebayasi		netbsd.ro ---> netbsd		Kernel MD linkage
2561.10Suebayasi
2571.10Suebayasi	Modular build (module):
2581.10Suebayasi		     *.o  --->      *.ko	Generic + Per-module MI linkage
2591.10Suebayasi		     *.ko --->      *.ro	Modular MI linkage
2601.10Suebayasi		     *.ro --->      *.kmod	Modular MD linkage
2611.10Suebayasi
2621.32Swiz  Generic MI linkage is for processing MI linkage that can be applied generally.
2631.10Suebayasi  Data section alignment (.data.read_mostly and .data.cacheline_aligned) is
2641.10Suebayasi  processed here.
2651.10Suebayasi
2661.10Suebayasi  Per-module MI linkage is for modules that want some ordering.  For example,
2671.10Suebayasi  machdep.ko wants to put entry code at the top of .text and .data.
2681.10Suebayasi
2691.10Suebayasi  Kernel MI linkage is for collecting kernel global section data, that is what
2701.10Suebayasi  link-set is used for now.  Once they are collected and symbols to the ranges
2711.10Suebayasi  are assigned, those sections are merged into the pre-existing sections
2721.10Suebayasi  (.rodata) because link-set sections in "netbsd" will never be interpreted by
2731.10Suebayasi  external loaders.
2741.10Suebayasi
2751.10Suebayasi  Kernel MD linkage is used purely for MD purposes, that is, how kernels are
2761.10Suebayasi  loaded by external loaders.  It might be possible that one kernel relocatable
2771.34Sandvar  (netbsd.ro) is linked into multiple final kernel image (netbsd) for different
2781.10Suebayasi  load addresses.
2791.10Suebayasi
2801.11Suebayasi  Modular MI linkage is to prepare a module to be loadable as modular(9).  This
2811.11Suebayasi  may add some extra sections and/or symbols.
2821.11Suebayasi
2831.11Suebayasi  Modular MD linkage is again for pure MD purposes like kernel MD linkage.
2841.11Suebayasi  Adjustment and/or optimization may be done.
2851.11Suebayasi
2861.11Suebayasi  Kernel and modular MI linkages may change behavior depending on existence
2871.11Suebayasi  of debug information.  In the future .symtab will be copied using linker
2881.11Suebayasi  during this stage.
2891.13Suebayasi
2901.24Suebayasio Fix db_symtab copying (COPY_SYMTAB)
2911.24Suebayasi
2921.24Suebayasi  o Collect all objects and create a relocatable (netbsd.ro).  At this point,
2931.24Suebayasi    the number of symbols is known.
2941.24Suebayasi
2951.24Suebayasi  o Relink and allocate .rodata.symtab with the calculated size of .symtab.
2961.24Suebayasi    Linker recalculates symbol addresses.
2971.24Suebayasi
2981.24Suebayasi  o Embed the .symtab into .rodata.symtab.
2991.24Suebayasi
3001.24Suebayasi  o Link the final netbsd ELF.
3011.24Suebayasi
3021.24Suebayasi  The make(1) rule (dependency graph) should be identical with/without
3031.24Suebayasi  COPY_SYMTAB.  Kill .ifdef COPY_SYMTAB from $S/conf/Makefile.kern.inc.
3041.24Suebayasi
3051.19Suebayasio Preprocess and generate linker scripts dynamically.
3061.19Suebayasi
3071.19Suebayasi  Include opt_xxx.h and replace some constant values (e.g. COHERENCY_UNIT,
3081.19Suebayasi  PAGE_SIZE, KERNEL_BASE_PHYS, KERNEL_BASE_VIRT, ...) with cpp(1).
3091.19Suebayasi
3101.19Suebayasi  Don't unnecessarily define symbols.  Don't use sed(1).
3111.19Suebayasi
3121.19Suebayasio Clean up linker scripts.
3131.19Suebayasi
3141.19Suebayasi  o Don't specify OUTPUT_FORMAT()/OUTPUT_ARCH()
3151.19Suebayasi
3161.19Suebayasi    These are basically set in compilers/linkers.  If non-default ABI is used,
3171.19Suebayasi    command-line arguments should be specified.
3181.19Suebayasi
3191.19Suebayasi  o Remove .rel/.rela handlings.
3201.19Suebayasi
3211.19Suebayasi    These are set in relocatable objects, and handled by dynamic linkers.
3221.33Sandvar    Totally irrelevant for kernels.
3231.19Suebayasi
3241.19Suebayasi  o Clean up debug section handlings.
3251.19Suebayasi
3261.19Suebayasi  o Document (section boundary) symbols set in linker scripts.
3271.19Suebayasi
3281.19Suebayasi    There must be a reason why symbols are defined and exported.
3291.19Suebayasi
3301.19Suebayasi    PROVIDE() is to define internal symbols.
3311.19Suebayasi
3321.19Suebayasi  o Clean up load addresses.
3331.19Suebayasi
3341.19Suebayasi  o Program headers.
3351.19Suebayasi
3361.19Suebayasi  o According to matt@, .ARM.extab/.ARM.exidx sections are no longer needed.
3371.19Suebayasi
3381.13Suebayasio Redesign swapnetbsd.c (root/swap device specification)
3391.13Suebayasi
3401.13Suebayasi  Don't build a whole kernel only to specify root/swap devices.
3411.13Suebayasi
3421.13Suebayasi  Make these parameter re-configurable afterwards.
3431.14Suebayasi
3441.14Suebayasio Namespace.
3451.14Suebayasi
3461.14Suebayasi  Investigate namespace of attributes/modules/options.  Figure out the hidden
3471.14Suebayasi  design about these, document it, then re-design it.
3481.14Suebayasi
3491.14Suebayasi  At this moment, all of them share the single "selecttab", which means their
3501.14Suebayasi  namespaces are common, but they also have respective tables (attrtab,
3511.14Suebayasi  opttab, etc.).
3521.14Suebayasi
3531.14Suebayasi  Selecting an option (addoption()), that is also a module name, works only if
3541.14Suebayasi  the module doesn't depend on anything, because addoption() doesn't select
3551.14Suebayasi  module and its dependencies (selectattr()).  In other words, an option is
3561.14Suebayasi  only safely converted to a module (define), only if it doesn't depend on
3571.14Suebayasi  anything.  (One example is DDB.)
3581.17Suebayasi
3591.17Suebayasio Convert pseudo(dev) attach functions to take (void) (== kernel ctors).
3601.17Suebayasi
3611.17Suebayasi  The pseudo attach function was originally designed to take `int n' as
3621.17Suebayasi  the number of instances of the pseudo device.  Now most of pseudo
3631.17Suebayasi  devices have been converted to be `cloneable', meaning that their
3641.17Suebayasi  instances are dynamically allocated at run-time, because guessing how
3651.17Suebayasi  much instances are needed for users at compile time is almost impossible.
3661.17Suebayasi  Restricting such a pure software resource at compile time is senseless,
3671.17Suebayasi  considering that the rest of the world is dynamic.
3681.17Suebayasi
3691.17Suebayasi  If pseudo attach functions once become (void), config(1) no longer
3701.17Suebayasi  has to generate iteration to call those functions, by making them part
3711.17Suebayasi  of kernel constructors, that are a list of (void) functions.
3721.17Suebayasi
3731.17Suebayasi  Some pseudo devices may have dependency/ordering problems, because
3741.17Suebayasi  pseudo attach functions have no choice when to be called.  This could
3751.17Suebayasi  be solved by converting to kctors, where functions are called in order
3761.17Suebayasi  by dependency.
3771.18Spgoyette
3781.18Spgoyetteo Enhance ioconf behavior for pseudo-devices
3791.18Spgoyette
3801.18Spgoyette  See "bin/48571: config(1) ioconf is insufficient for pseudo-devices" for
3811.18Spgoyette  more details.  In a nutshell, it would be "useful" for config to emit
3821.18Spgoyette  the necessary stuff in the generated ioconf.[ch] to enable use of
3831.18Spgoyette  config_{init,fini}_component() for attaching and detaching pseudodev's.
3841.18Spgoyette
3851.18Spgoyette  Currently, you need to manually construct your own data structures, and
3861.18Spgoyette  manually "attach" them, one at a time.  This leads to duplication of
3871.18Spgoyette  code (where multiple drivers contain the same basic logic), and doesn't
3881.18Spgoyette  necessarily handle all of the "frobbing" of the kernel lists.
3891.20Suebayasi
3901.22Suebayasio Don't use -Ttext ${TEXTADDR}.
3911.22Suebayasi
3921.22Suebayasi  Although ld(1)'s `-Ttext ${TEXTADDR}' is an easy way to specify the virtual
3931.22Suebayasi  base address of .text at link time, it needs to change command-line; in
3941.22Suebayasi  kernel build, Makefile needs to change to reflect kernel's configuration.
3951.33Sandvar  It is simpler to reflect kernel configuration using linker script via assym.h.
3961.22Suebayasi
3971.20Suebayasio Convert ${DIAGNOSTIC} and ${DEBUG} as flags (defflag).
3981.20Suebayasi
3991.20Suebayasi  Probably generate opt_diagnostic.h/opt_debug.h and include them in
4001.20Suebayasi  sys/param.h.
4011.20Suebayasi
4021.20Suebayasio Strictly define DIAGNOSTIC.
4031.20Suebayasi
4041.20Suebayasi  It is possible to make DIAGNOSTIC kernel and modules binary-compatible with
4051.33Sandvar  non-DIAGNOSTIC ones.  In that case, debug type information should match
4061.20Suebayasi  theoretically (not confirmed).
4071.23Suebayasi
4081.25Suebayasio Use suffix rules.
4091.25Suebayasi
4101.25Suebayasi  Build objects following suffix rules.  Source files are defined as relative to
4111.25Suebayasi  $S (e.g. sys/kern/init_main.c) and objects are generated in the corresponding
4121.25Suebayasi  subdirectories under kernel build directories (e.g.
4131.25Suebayasi  .../compile/GENERIC/sys/kern/init_main.o).  Dig subdirectories from within
4141.25Suebayasi  config(1).
4151.25Suebayasi
4161.25Suebayasi  Debugging (-g) and profiling (-pg) objects could be generated with *.go/*.po
4171.25Suebayasi  suffixes as userland libraries do.  Maybe something similar for
4181.25Suebayasi  DIAGNOSTIC/DEBUG.
4191.25Suebayasi
4201.25Suebayasi  genassym(1) definitions will be split into per-source instead of the single
4211.33Sandvar  assym.h.  Dependencies are corrected and some of mysterious dependencies on
4221.25Suebayasi  `Makefile' in sys/conf/Makefile.kern.inc can go away.
4231.25Suebayasi
4241.23Suebayasio Define genassym(1) symbols per file.
4251.23Suebayasi
4261.23Suebayasi  Have each file define symbols that have to be generated by genassym(1) so
4271.23Suebayasi  that more accurate dependency is reflected.
4281.23Suebayasi
4291.23Suebayasi  For example, if foo.S needs some symbols, it defines them in foo.assym,
4301.23Suebayasi  declaring that foo.S depends on foo.assym.h, and includes foo.assym.h.
4311.23Suebayasi  foo.assym.h is generated by following the suffix rule of .assym -> .assym.h.
4321.23Suebayasi  When one header is updated, only related *.assym.h files are regenerated,
4331.23Suebayasi  instead of rebuilding all MD/*.S files that depend on the global, single
4341.23Suebayasi  assym.h.
4351.27Suebayasi
4361.27Suebayasio Support library.
4371.27Suebayasi
4381.27Suebayasi  Provide a consistent way to build library either as .o or .a.
4391.27Suebayasi
4401.30Suebayasi  Build libraries in sub-make.  Don't include library makefiles.  Don't
4411.30Suebayasi  pollute search path (.PATH).  libkern does too much.
4421.30Suebayasi
4431.27Suebayasio Accept `.a' suffix.
4441.27Suebayasi
4451.27Suebayasi  Make "file" command accept `.a' suffix.  Handle it the same way as `.o'.
4461.28Suebayasi
4471.28Suebayasio Clean up ${MD_OBJS} and friends in Makefile.${MACHINE}.
4481.28Suebayasi
4491.28Suebayasi  Don't use ${MD_OBJS}, ${MD_LIBS}, ${MD_SFILES}, and ${MD_CFILES}.
4501.28Suebayasi
4511.33Sandvar  List files in config(5)'s "file".  Override build rules only when necessary.
4521.28Suebayasi
4531.28Suebayasi  Rely on the fact that config(1) parses files.${MACHINE} first, outputs
4541.28Suebayasi  files in the order it parses files.* (actually include depth), and
4551.28Suebayasi  `Makefile.kern.inc' preserve file order to pass to ${LD}.
4561.29Suebayasi
4571.29Suebayasio Clean up CTF-related rules.
4581.29Suebayasi
4591.29Suebayasi  Don't overwrite compile/link rules conditionally by existence of
4601.29Suebayasi  ${CTFCONVERT}/${CTFMERGE}.  Give a separate suffix (*.ctfo) and define its
4611.29Suebayasi  rules (.c -> .ctfo).
4621.31Suebayasi
4631.31Suebayasio Consider using cpp -MD instead of ${MKDEP}.
4641.31Suebayasi
4651.31Suebayasio Make "make depend" mandatory.
4661.31Suebayasi
4671.31Suebayasi  Automatically execute "make depend".
468