loader: add docker build for linux
This commit is contained in:
32
alchitry-loader/Makefile
Normal file
32
alchitry-loader/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
sources = $(wildcard src/*.cpp)
|
||||
objects = $(sources:.cpp=.o)
|
||||
os = $(shell uname -s)
|
||||
static_libs = lib/$(os)/libftd2xx.a
|
||||
libs = -lpthread
|
||||
|
||||
CXXFLAGS = -std=c++11
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
# Assume target is Mac OS if build host is Mac OS; any other host targets Linux
|
||||
ifeq ($(os), Darwin)
|
||||
libs += -lobjc -framework IOKit -framework CoreFoundation
|
||||
else
|
||||
libs += -lrt
|
||||
endif
|
||||
|
||||
loader: $(objects) ## build the loader executable
|
||||
$(CXX) $(LDFLAGS) -o $@ $^ $(static_libs) $(libs)
|
||||
|
||||
build: ## build the loader in docker (linux)
|
||||
docker build -o . .
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf loader $(objects)
|
||||
|
||||
.PHONY: help
|
||||
help: ## Show this help
|
||||
@echo Noteworthy targets:
|
||||
@egrep '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
.DEFAULT_GOAL := help
|
Reference in New Issue
Block a user