Skip to content

Commit

Permalink
Merge pull request #8 from devilbox/platform-file
Browse files Browse the repository at this point in the history
Add platform Makefile
  • Loading branch information
cytopia authored Oct 24, 2022
2 parents d0f9cb5 + 0b94ef4 commit bc0da08
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
27 changes: 27 additions & 0 deletions Makefile.platform
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ifneq (,)
.error This Makefile requires GNU Make.
endif

ifndef VERBOSE
MAKEFLAGS += --no-print-directory
endif


# -------------------------------------------------------------------------------------------------
# Default configuration
# -------------------------------------------------------------------------------------------------
ARCH = linux/amd64


# -------------------------------------------------------------------------------------------------
# Dynamic configuration
# -------------------------------------------------------------------------------------------------
_PLATFORM = $(shell uname -m)

ifeq ($(strip $(_PLATFORM)),x86_64)
ARCH = linux/amd64
else
ifeq ($(strip $(_PLATFORM)),arm64)
ARCH = linux/arm64
endif
endif
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ifneq (,)
endif

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

`.gitignore`:
```gitignore
Makefile.docker
Makefile.lint
Makefile.platform
```


## License

Expand Down

0 comments on commit bc0da08

Please sign in to comment.