Go to file
2016-08-21 11:05:22 +02:00
README.md add README.md 2016-08-21 11:05:22 +02:00

This repository contains the Illumos make source code (in branch illumos) and based on that a port to Linux (branch master).

The Illumos make is based on Sun's dmake, which is compatible to Sun make.

Motivation: compile old Solaris projects (that use Sun make) under Linux without much effort. Think: the C code needs serious fixing because it includes metric tons of non-portable constructs such that you want to postpone the porting of the existing build system (which heavily uses Sun make specific extensions).

Another motivation to use a Sun compatible make might be the inclination to test one of its extensions, e.g. target groups, command and hidden dependencies.

2016, Georg Sauthofff mail@georg.so

Background

Illumos is based on OpenSolaris, the now discontinued open-source version of Solaris. OpenSolaris was started by Sun after the Solaris 10 release and was closed down in 2010 after Oracle bought Sun. Sun used the CDDL license on its open sourced code.

Traditionally, Solaris includes it own version of make under /usr/ccs/bin/make, also known as 'Sun make'. It has some extensions over other make versions, such as BSD make and POSIX make. It only supports sequential execution (unlike e.g. GNU make), however, Sun also developed dmake (think: distributed make), usually bundled with the Solaris compiler suite 'Solaris Studio'. Dmake is compatible with the Sun make syntax and besides serial execution it supports parallel execution on an SMP system and on a cluster (apparently similar to distcc). It was also open-sourced by Sun under the CDDL.

Illumos started with the code base that included the original Sun make but later switched to dmake.

GNU make is the most popular, portable and thus relevant make. Similar to most GNU tools it contains many very useful extension over the traditional make and it basically runs everywhere.

Examples of GNU make features that are missing from Sun make:

  • parallel execution (the Sun make compatible dmake supports it)
  • conditional constructs
  • many built-in function
  • user-defined functions
  • templates
  • guile integration
  • generation of included files

Sun make features that aren't supported by GNU make:

  • target groups - i.e. to specify that more than one target depends on a source file and that the one action generates those targets at once. GNU make only supports a group of targets with pattern rules.
  • command dependencies - i.e. a target is also considered out-of-date if the command changes - i.e. due to changed values of variables like $(CC) or $(CFLAGS)
  • hidden dependencies - automatic discovery of header dependencies

There are also extension where GNU and Sun make just use different syntax. For example, conditional macros:

  • Sun make: target := VAR = value
  • GNU make: taget: VAR = value

(Note that GNU make interprets := as assignment with immediate expansion.)

The distributed make that came with OpenOffice is also named DMake. It seems that it was independently developed of Sun's dmake - and that it uses a different syntax.

Portability

The changes in the master branch fix portability issues in the original code such that the resulting make compiles and runs under Linux. Also, a CMake build file is included for portable building.

Although those changes target Linux, they aren't really Linux specific. That means that the ported make should also compile on other modern POSIXy operating systems.

Naming

I avoided the names dmake, imake and smake because there are already multiple published make versions that use those names. There is a dmake that comes with Solaris Studio, a dmake bundled with OpenOffice, a dmake that OpenOffice's dmake is based on, an imake to build old X versions and the Schily smake.

Thus, to not add to the confusion I chose somake.

License

Perhaps not required by the CDDL, but I license my changes also under the CDDL.