-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM docker.io/library/debian:11 as base | ||
|
||
RUN apt-get -qq update -y | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
libusb-1.0.0-dev \ | ||
git \ | ||
sdcc \ | ||
ca-certificates | ||
|
||
# Cleanup cached apt stuff | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
FROM base as toolsbuilder | ||
|
||
# Tools that needs to be built from source | ||
|
||
RUN git clone https://github.com/ole00/chprog.git /src | ||
WORKDIR /src | ||
RUN ./build_linux.sh | ||
RUN cp ./chprog /usr/local/bin | ||
|
||
From base | ||
COPY --from=toolsbuilder /usr/local/ /usr/local | ||
|
||
RUN apt-get -qq update -y | ||
|
||
# Needed for git --describe to work | ||
RUN git config --global --add safe.directory /build |
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,26 @@ | ||
all: | ||
@echo "Build targets: " | ||
@echo "build-docker Build an image for building tools with Docker" | ||
@echo "build Build project assets from within Docker container" | ||
@echo "run Run a shell using the above image with Docker" | ||
|
||
IMAGE_NAME=ch554_sdcc | ||
|
||
|
||
COMMON = run \ | ||
--rm \ | ||
--mount type=bind,source="`pwd`/..",target=/build \ | ||
-w /build \ | ||
|
||
build-docker: | ||
docker build -t ${IMAGE_NAME} -f Dockerfile . | ||
|
||
build: | ||
docker ${COMMON} \ | ||
-it ${IMAGE_NAME} \ | ||
/bin/bash -c "cd examples; make clean; make" | ||
|
||
run: | ||
docker ${COMMON} \ | ||
-it ${IMAGE_NAME} \ | ||
/bin/bash |
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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
SUBDIRS = $(shell ls -d */) | ||
|
||
.PHONY: $(SUBDIRS) | ||
|
||
.PHONY: $(SUBDIRS) clean | ||
|
||
$(SUBDIRS): | ||
$(MAKE) -C $@ | ||
|
||
.DEFAULT_GOAL := all | ||
all: $(SUBDIRS) | ||
|
||
clean: | ||
@for dir in $(SUBDIRS); do \ | ||
$(MAKE) -C $$dir clean; \ | ||
done | ||
|
||
print-% : ; @echo $* = $($*) | ||
|
||
|