aboutsummaryrefslogtreecommitdiffstats
path: root/src/prog.mk
Commit message (Collapse)AuthorAge
* build: remove unnecessary distclean targetsLibravatar Kelvin M. Klann2023-07-20
| | | | This also fixes the duplicate execution of the "clean" targets.
* build: move remaining build flags into config.mk.inLibravatar Kelvin M. Klann2023-06-25
| | | | Put all definitions in the same file.
* build: move common CFLAGS/LDFLAGS firstLibravatar Kelvin M. Klann2023-06-25
|
* build: standardize clean/distclean targets in srcLibravatar Kelvin M. Klann2023-06-25
| | | | | | | Changes: * clean: remove the same types of files in src/prog.mk and src/so.mk * distclean: remove unused recipes and DISTCLEANFILES variable
* build: rename TOCLEAN and TODISTCLEAN variablesLibravatar Kelvin M. Klann2023-06-24
| | | | | | | | | | | | | | | | To CLEANFILES and DISTCLEANFILES, respectively. This matches what GNU automake uses. Commands used to search and replace: $ git grep -IFlz -e TOCLEAN -e TODISTCLEAN | xargs -0 -I '{}' sh -c "printf '%s\n' \"\$(sed \ -e 's/TOCLEAN/CLEANFILES/g' \ -e 's/TODISTCLEAN/DISTCLEANFILES/g' '{}')\" >'{}'" Added on commit cbdee6555 ("makefiles: add TOCLEAN and TODISTCLEAN variables", 2022-07-15) / PR #5478.
* build: rename MOD vars to EXTRA varsLibravatar Kelvin M. Klann2023-06-24
| | | | | | | | | | | | | | | To make them less confusing, as they are extra dependencies, not files that are specific to the module. Commands used to search and replace: $ git grep -IFlz -e 'MOD_HDRS' -e 'MOD_OBJS' -- src | xargs -0 -I '{}' sh -c "printf '%s\n' \"\$(sed \ -e 's/MOD_HDRS/EXTRA_HDRS/g' \ -e 's/MOD_OBJS/EXTRA_OBJS/g' '{}')\" >'{}'" Added on commit f5b1ccaad ("makefiles: move extra deps into new MOD vars", 2022-05-07) / PR #5478.
* build: remove MOD_SRCS variableLibravatar Kelvin M. Klann2023-06-24
| | | | | | | It is unused and is unlikely to be used. Added on commit f5b1ccaad ("makefiles: move extra deps into new MOD vars", 2022-05-07) / PR #5478.
* build: enable compiler warnings by defaultLibravatar Kelvin M. Klann2023-05-31
| | | | Enable -Wall by default and add -Wextra.
* build: organize warning flags in CFLAGSLibravatar Kelvin M. Klann2023-05-31
|
* makefiles: stop overriding CFLAGS/LDFLAGSLibravatar Kelvin M. Klann2022-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the manual of GNU Automake (version 1.16.5)[1] [2]: > 3.6 Variables reserved for the user > > Some `Makefile` variables are reserved by the GNU Coding Standards for > the use of the "user"—the person building the package. For instance, > `CFLAGS` is one such variable. > > Sometimes package developers are tempted to set user variables such > as `CFLAGS` because it appears to make their job easier. However, the > package itself should never set a user variable, particularly not to > include switches that are required for proper compilation of the > package. Since these variables are documented as being for the > package builder, that person rightfully expects to be able to override > any of these variables at build time. > > To get around this problem, Automake introduces an > automake-specific shadow variable for each user flag variable. > (Shadow variables are not introduced for variables like `CC`, where > they would make no sense.) The shadow variable is named by prepending > `AM_` to the user variable's name. For instance, the shadow variable > for `YFLAGS` is `AM_YFLAGS`. The package maintainer—that is, the > author(s) of the `Makefile.am` and `configure.ac` files—may adjust > these shadow variables however necessary. > > Note Flag Variables Ordering::, for more discussion about these > variables and how they interact with per-target variables. See also the description of CFLAGS in the GNU Autoconf manual[3]. Note: We do not use automake (save for aclocal) nor generally follow the GNU Coding Standards, but the concept still applies. Also, the closest analogous in the project to the `AM_` prefix would currently likely be `EXTRA_`. [1] https://www.gnu.org/software/automake/manual/1.16.5/html_node/User-Variables.html [2] https://www.gnu.org/software/automake/manual/1.16.5/html_node/Flag-Variables-Ordering.html [3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Preset-Output-Variables.html
* makefiles: organize CFLAGSLibravatar Kelvin M. Klann2022-11-21
| | | | | | | | Line-wrap them and make the order of the flags more similar across src/prog.mk and src/so.mk. This should make it easier to see the differences in CFLAGS between both files.
* makefiles: mention variables intended to be used by includersLibravatar Kelvin M. Klann2022-11-21
| | | | On src/prog.mk and src/so.mk.
* makefiles: add TOCLEAN and TODISTCLEAN variablesLibravatar Kelvin M. Klann2022-11-21
| | | | | | | | | | | So that includers of src/prog.mk or src/so.mk can just define anything extra that needs to be cleaned without having to override the "clean" target (or having to declare a "distclean" target). Example usage: TOCLEAN += foo TODISTCLEAN += bar
* makefiles: rename common.mk to prog.mkLibravatar Kelvin M. Klann2022-11-21
For clarity, as it is included by the Makefiles that create programs and non-shared-objects, but not by the ones that create shared objects (see src/so.mk). Commands used to move and search and replace: $ git mv src/common.mk src/prog.mk $ git grep -IFlz 'common.mk' -- src | xargs -0 -I '{}' sh -c \ "printf '%s\n' \"\$(sed 's/common.mk/prog.mk/' '{}')\" >'{}'"