Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
siriushq/cpdpmake ================= A cross-platform, single-binary Makefile executor. This is intended to be runnable on Linux, macOS, Windows, FreeBSD, OpenBSD and NetBSD on both amd64 and arm64 architectures, out-of-the-box. This uses APE (Actually Portable Executable) as provided by the Cosmpolitan libc project <https://www.cosmo.zip> under ISC. No Cosmpolitan-specific features are used, and this project can be built as-is with most C toolchains. building ======== Add the latest `cpdpmake.com` release to your repository. Alternatively, build it yourself on an amd64 Linux machine (which can cross compile for all others supported) as follows: # Download the `cosmocc` compiler $ curl -LO https://cosmo.zip/pub/cosmocc/cosmocc.zip $ unzip cosmocc.zip # Invoke `make` providing `CC` $ make CC=./cosmocc/bin/cosmocc # Invoke it $ ./cpdpmake.com -h This project is bundled with a Makefile used to build itself, but this is not required and with most toolchains the following command is the only requirement: $ cc -o cpdpmake *.c using ===== The default configuration enables some non-POSIX extensions. Generally, these are compatible with GNU or BSD make extensions: 1. double-colon rules 2. `ifdef`/`ifndef`/`ifeq`/`ifneq`/`else`/`endif` conditionals 3. `lib.a(mem1.o mem2.o...)` syntax for archive members 4. `:=` macro assignments (equivalent to POSIX `::=`) 5. chained inference rules 6. `*`/`?`/`[]` wildcards for filenames in target rules 7. the `$<` and `$*` internal macros are valid for target rules 8. skip duplicate entries in `$?` 9. `-C directory` command line option 10. `#` doesn't start a comment in macro expansions or build commands 11. `#` may be escaped with a backslash 12. macro definitions and targets can be mixed on the command line To compare with other third-party implementations: - in make(1) of NetBSD, OpenBSD, FreeBSD, DragonFly BSD, all features are fully supported, except: #2 (as they use prefixed conditionals, e.g. '.ifdef') #10 (as # may be interpreted during macro expansion, while build commands preserve it for the shell) - in make(1) of GNU, all features are supported as-is. - in macOS, make(1) of GNU and make(1) of NetBSD are both available in brew, as gmake(1) and bmake(1) respectively. - in make(1) of AIX, HP-UX, Solaris (+ dmake(1)), BSD4.3, BSD4.4, and bsdmake(1) in brew on macOS, it can generally be assumed that vendor specific extensions exist and vary, but compatibility is not to be expected with these ones. This implementation can usually just be made and ran if a project is to be built on these operating systems. When extensions are enabled, adding the `.POSIX` target to your Makefile, setting (any value to) the `PDPMAKE_POSIXLY_CORRECT` environment variable, or passing the `--posix` flag as the first argument, will disable them (other versions of make tend to allow extensions even in POSIX mode). When using on Windows, the rules that apply to Cosmopolitan libc's `system` implementation (that mimics a Bourne shell) apply: - paths are seperated with forward slashes (`/`) - drive letters do not require a colon (e.g. `/C/Windows/`) - some built-in utilities are available, including exit, cd, rm, [, cat, wait, exec, env, echo, read, true, test, kill, touch, rmdir, mkdir, false, mktemp, sed, tr, usleep, etc.