|
1 | 1 | # GNU makefile proxy script for BSD make
|
| 2 | +# |
2 | 3 | # Written and maintained by Mahmoud Al-Qudsi <[email protected]>
|
3 |
| -# Copyright NeoSmart Technologies <https://neosmart.net/> 2014-2018 |
| 4 | +# Copyright NeoSmart Technologies <https://neosmart.net/> 2014-2019 |
4 | 5 | # Obtain updates from <https://github.com/neosmart/gmake-proxy>
|
5 | 6 | #
|
6 | 7 | # Redistribution and use in source and binary forms, with or without
|
|
26 | 27 |
|
27 | 28 | JARG =
|
28 | 29 | GMAKE = "gmake"
|
29 |
| -#When gmake is called from another make instance, -w is automatically added |
30 |
| -#which causes extraneous messages about directory changes to be emitted. |
31 |
| -#--no-print-directory silences these messages. |
| 30 | +# When gmake is called from another make instance, -w is automatically added |
| 31 | +# which causes extraneous messages about directory changes to be emitted. |
| 32 | +# Running with --no-print-directory silences these messages. |
32 | 33 | GARGS = "--no-print-directory"
|
33 | 34 |
|
34 | 35 | .if "$(.MAKE.JOBS)" != ""
|
35 |
| -JARG = -j$(.MAKE.JOBS) |
| 36 | + JARG = -j$(.MAKE.JOBS) |
36 | 37 | .endif
|
37 | 38 |
|
38 |
| -#by default bmake will cd into ./obj first |
| 39 | +# bmake prefers out-of-source builds and tries to cd into ./obj (among others) |
| 40 | +# where possible. GNU Make doesn't, so override that value. |
39 | 41 | .OBJDIR: ./
|
40 | 42 |
|
| 43 | +# The GNU convention is to use the lowercased `prefix` variable/macro to |
| 44 | +# specify the installation directory. Humor them. |
| 45 | +GPREFIX = "" |
| 46 | +.if defined(PREFIX) && ! defined(prefix) |
| 47 | + GPREFIX = 'prefix = "$(PREFIX)"' |
| 48 | +.endif |
| 49 | + |
| 50 | +.BEGIN: .SILENT |
| 51 | + which $(GMAKE) || printf "Error: GNU Make is required!\n\n" 1>&2 && false |
| 52 | + |
41 | 53 | .PHONY: FRC
|
42 | 54 | $(.TARGETS): FRC
|
43 |
| - $(GMAKE) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG) |
| 55 | + $(GMAKE) $(GPREFIX) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG) |
44 | 56 |
|
45 | 57 | .DONE .DEFAULT: .SILENT
|
46 |
| - $(GMAKE) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG) |
47 |
| - |
48 |
| -.ERROR: .SILENT |
49 |
| - if ! which $(GMAKE) > /dev/null; then \ |
50 |
| - echo "GNU Make is required!"; \ |
51 |
| - fi |
| 58 | + $(GMAKE) $(GPREFIX) $(GARGS) $(.TARGETS:S,.DONE,,) $(JARG) |
0 commit comments