-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It was a rainy weekend. :) Running 'make help' will get you all the details. * It does everything the script based build does. * It's easier to use. * It's easier to customize and set defaults. * It does NOT disturb the current script based deb build.
- Loading branch information
Showing
20 changed files
with
548 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
|
||
# Passing V=1 on the make command line turns on verbose mode | ||
ifeq ($(V),1) | ||
ECHO_PREFIX=@ | ||
CMD_PREFIX= | ||
DOTNET_VERB=minimal | ||
DOTNET_RETRY= | ||
else | ||
ECHO_PREFIX=@ | ||
CMD_PREFIX=@>/dev/null | ||
DOTNET_VERB=quiet | ||
# In quiet mode, if a dotnet command fails, it'll be re-run in verbose mode | ||
# so you can see the errors. | ||
DOTNET_RETRY= || { echo " dotnet $(DOTNET_ARGS)" ; dotnet $(DOTNET_ARGS) ; } | ||
endif | ||
|
||
.PHONY: $(TARGET) build publish clean info | ||
|
||
ARCH = armhf | ||
CONFIG = Debug | ||
|
||
TARGET_TITLE = printf " [%-9s] %-21s %-7s %-7s %-7s\n" | ||
|
||
-include ../../Makefile.local | ||
|
||
TARGET ?= $(shell basename `pwd`) | ||
RUNTIME := $(shell dotnet --version | sed -n -r -e "s/^([0-9]+[.][0-9]+).*/\1/gp") | ||
# The ARCH passed in is the package architecure so we translate it to | ||
# a dotnet runtime. | ||
DOTNET_ARCH = $(shell ../../pkg/common/get_dotnet_arch $(ARCH)) | ||
SOURCES := $(shell find -name "*.cs") | ||
BIN = bin/$(CONFIG)/netcoreapp$(RUNTIME)/$(DOTNET_ARCH)/$(TARGET) | ||
DESTDIR = bin/$(CONFIG)/netcoreapp$(RUNTIME)/$(DOTNET_ARCH)/publish/ | ||
|
||
build: $(BIN) | ||
|
||
$(BIN): DOTNET_ARGS = build --nologo -r $(DOTNET_ARCH) -c $(CONFIG) -o bin/$(CONFIG)/netcoreapp$(RUNTIME)/$(DOTNET_ARCH)/ | ||
$(BIN): *.csproj $(SOURCES) | ||
$(ECHO_PREFIX)$(TARGET_TITLE) build $(TARGET) "" $(CONFIG) $(DOTNET_ARCH) | ||
$(CMD_PREFIX) dotnet $(DOTNET_ARGS) -v $(DOTNET_VERB) $(DOTNET_RETRY) | ||
|
||
|
||
$(DESTDIR)/$(TARGET): DOTNET_ARGS = publish --nologo -r $(DOTNET_ARCH) -c $(CONFIG) -o $(DESTDIR) | ||
$(DESTDIR)/$(TARGET): $(BIN) | ||
$(ECHO_PREFIX)$(TARGET_TITLE) publish $(TARGET) "" $(CONFIG) $(DOTNET_ARCH) | ||
$(CMD_PREFIX) dotnet $(DOTNET_ARGS) -v $(DOTNET_VERB) $(DOTNET_RETRY) | ||
|
||
publish: $(DESTDIR)/$(TARGET) | ||
|
||
clean: | ||
$(ECHO_PREFIX)$(TARGET_TITLE) CLEAN $(TARGET) "" "" | ||
$(CMD_PREFIX) rm -rf bin obj | ||
|
||
info: | ||
@echo "ARCH: $(ARCH)" | ||
@echo "TARGET: $(TARGET)" | ||
@echo "RUNTIME: $(RUNTIME)" | ||
@echo "CONFIG: $(CONFIG)" | ||
@echo "BIN: $(BIN)" | ||
@echo "DESTDIR: $(DESTDIR)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ] ; then | ||
echo "Usage: $0 <package_architecture>" | ||
echo " Returns the equivalent dotnet runtime architecture" | ||
exit 1 | ||
fi | ||
|
||
DOTNET_ARCH= | ||
|
||
case $1 in | ||
armhf|armhfp|armv7h|armv7hl) DOTNET_ARCH=linux-arm ;; | ||
arm64|aarch64) DOTNET_ARCH=linux-arm64 ;; | ||
amd64|x86_64) DOTNET_ARCH=linux-x64 ;; | ||
i386|i686|x86_32) DOTNET_ARCH=linux-x86 ;; | ||
*) echo "Unknown package architecture: $1" ; exit 1 ;; | ||
esac | ||
|
||
echo $DOTNET_ARCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=CodeConsole | ||
|
||
include ../../Makefile.components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=CodeLogger | ||
|
||
include ../../Makefile.components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=CustomHttpEndpoint | ||
|
||
include ../../Makefile.components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=DuetAPI.dll | ||
|
||
include ../../Makefile.components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=DuetAPIClient.dll | ||
|
||
include ../../Makefile.components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=DuetControlServer | ||
|
||
include ../../Makefile.components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=DuetWebServer | ||
|
||
include ../../Makefile.components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=LinuxDevices.dll | ||
|
||
include ../../Makefile.components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
TARGET=ModelObserver | ||
|
||
include ../../Makefile.components |