freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] Minor build system improvements


From: David Turner
Subject: [patches] Minor build system improvements
Date: Fri, 1 May 2020 00:22:20 +0200

Here are two cumulative patches that try to simplify the rules.mk and module.mk used by the FreeType 2 build system. The point is to remove GNU-Make specific statements from these files, making them declarative instead. I.e. after applying the first patch, a module.mk will contain something like:

# See builds/modules.mk for documentation about this file's content
MODULE_CLASS_NAME := sfnt
MODULE_CLASS_TYPE := module
MODULE_CLASS_DESCRIPTION := Helper module for TrueType & OpenType formats

Similarly, after applying the second patch, a rules.mk will look like:

MODULE_SOURCES := \
  pngshim.c   \
  sfdriver.c  \
  sfobjs.c    \
  sfwoff.c    \
  sfwoff2.c   \
  ttbdf.c     \
  ttcmap.c    \
  ttcolr.c    \
  ttcpal.c    \
  ttkern.c    \
  ttload.c    \
  ttmtx.c     \
  ttpost.c    \
  ttsbit.c    \
  woff2tags.c \

MODULE_HEADERS := \
  $(MODULE_SOURCES:%.c=%.h) \
  sferrors.h \

MODULE_WRAPPER := sfnt.c

Compared to their previous content, this drastically simplifies the file, and makes them much easier to understand and maintain. All of this comes at the price of more "magic" in the GNU Make scripts under builds/freetype.mk and builds/modules.mk, which now heavily use custom and non-trivial GNU Make functions (that I've tried to document as most as possible).

The goal is to make these files (rules.mk / module.mk) much easier to parse with something else, so we can start experimenting with better build systems. It shouldn't be difficult to write a small Python script that reads these files for example, then transform that into something more interesting (e.g. a CMake / Meson / GN fragment).

Please take a look and let me know if you have any issue with the approach used here.

NOTE: These patches should not change the output of the current build system at all!

- David


Attachment: 0001-build-Simplify-module.mk-syntax.patch
Description: Text Data

Attachment: 0002-build-Simplify-rules.mk-syntax.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]