Skip to content

Commit bc0da08

Browse files
authored
Merge pull request #8 from devilbox/platform-file
Add platform Makefile
2 parents d0f9cb5 + 0b94ef4 commit bc0da08

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

Makefile.platform

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ifneq (,)
2+
.error This Makefile requires GNU Make.
3+
endif
4+
5+
ifndef VERBOSE
6+
MAKEFLAGS += --no-print-directory
7+
endif
8+
9+
10+
# -------------------------------------------------------------------------------------------------
11+
# Default configuration
12+
# -------------------------------------------------------------------------------------------------
13+
ARCH = linux/amd64
14+
15+
16+
# -------------------------------------------------------------------------------------------------
17+
# Dynamic configuration
18+
# -------------------------------------------------------------------------------------------------
19+
_PLATFORM = $(shell uname -m)
20+
21+
ifeq ($(strip $(_PLATFORM)),x86_64)
22+
ARCH = linux/amd64
23+
else
24+
ifeq ($(strip $(_PLATFORM)),arm64)
25+
ARCH = linux/arm64
26+
endif
27+
endif

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ifneq (,)
1212
endif
1313

1414
# Ensure additional Makefiles are present
15-
MAKEFILES = Makefile.docker Makefile.lint
15+
MAKEFILES = Makefile.docker Makefile.lint Makefile.platform
1616
$(MAKEFILES): URL=https://raw.githubusercontent.com/devilbox/makefiles/master/$(@)
1717
$(MAKEFILES):
1818
@if ! (curl --fail -sS -o $(@) $(URL) || wget -O $(@) $(URL)); then \
@@ -23,6 +23,13 @@ $(MAKEFILES):
2323
include $(MAKEFILES)
2424
```
2525

26+
`.gitignore`:
27+
```gitignore
28+
Makefile.docker
29+
Makefile.lint
30+
Makefile.platform
31+
```
32+
2633

2734
## License
2835

0 commit comments

Comments
 (0)