diff --git a/.dockerignore b/.dockerignore index 7e8f5c5..35bcebd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,5 @@ machine-emulator-tools-*.ext2 rootfs* -libcmt* .clang-format .github .git diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7f5c5af..84e2958 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,9 +63,8 @@ jobs: load: true build-args: | TOOLS_TARGZ=${{ env.TOOLS_TARGZ }} - IMAGE_KERNEL_VERSION=${{ env.IMAGE_KERNEL_VERSION }} - LINUX_VERSION=${{ env.LINUX_VERSION }} LINUX_HEADERS_URLPATH=${{ env.LINUX_HEADERS_URLPATH }} + LINUX_HEADERS_SHA256=${{ env.LINUX_HEADERS_SHA256 }} cache-from: type=gha,scope=regular,mode=max cache-to: type=gha,scope=regular diff --git a/.gitignore b/.gitignore index 8f71610..77ea73c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,12 @@ rootfs.* package.json *.bin +sys-utils/hex/hex +sys-utils/ioctl-echo-loop/ioctl-echo-loop +sys-utils/rollup/rollup +sys-utils/xhalt/xhalt +sys-utils/yield/yield + # Prerequisites *.d diff --git a/Dockerfile b/Dockerfile index b393285..2d8fc9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,18 +15,13 @@ # FROM ubuntu:24.04 AS tools-env -ARG IMAGE_KERNEL_VERSION=v0.20.0 -ARG LINUX_VERSION=6.5.13-ctsi-1 -ARG LINUX_HEADERS_URLPATH=https://github.com/cartesi/image-kernel/releases/download/${IMAGE_KERNEL_VERSION}/linux-libc-dev-riscv64-cross-${LINUX_VERSION}-${IMAGE_KERNEL_VERSION}.deb -ARG BUILD_BASE=/opt/cartesi # Install dependencies -# ------------------------------------------------------------------------------ -ENV LINUX_HEADERS_FILEPATH=/tmp/linux-libc-dev-riscv64-cross-${LINUX_VERSION}-${IMAGE_KERNEL_VERSION}.deb - +ARG LINUX_HEADERS_URLPATH= +ARG LINUX_HEADERS_SHA256= +ADD ${LINUX_HEADERS_URLPATH} /tmp/linux-libc-dev-riscv64-cross.deb RUN < src/main.rs && \ - echo "pub fn dummy() {}" > src/lib.rs && \ - cargo build --target riscv64gc-unknown-linux-gnu --release - -# build rollup-http-server -FROM http-server-dep-builder AS http-server-builder -COPY --chown=developer:developer rollup-http/rollup-http-server/build.rs ${BUILD_BASE}/tools/rollup-http/rollup-http-server/ -COPY --chown=developer:developer rollup-http/rollup-http-server/src ${BUILD_BASE}/tools/rollup-http/rollup-http-server/src -RUN cd ${BUILD_BASE}/tools/rollup-http/rollup-http-server && touch build.rs src/* && \ - cargo build --target riscv64gc-unknown-linux-gnu --release - -# build echo-dapp dependencies -FROM rust-builder AS echo-dapp-dep-builder -COPY --chown=developer:developer rollup-http/echo-dapp/Cargo.toml rollup-http/echo-dapp/Cargo.lock ${BUILD_BASE}/tools/rollup-http/echo-dapp/ -RUN cd ${BUILD_BASE}/tools/rollup-http/echo-dapp && \ - mkdir src/ && echo "fn main() {}" > src/main.rs && \ - cargo build --target riscv64gc-unknown-linux-gnu --release - -# build echo-dapp -FROM echo-dapp-dep-builder AS echo-dapp-builder -COPY --chown=developer:developer rollup-http/echo-dapp/src ${BUILD_BASE}/tools/rollup-http/echo-dapp/src -RUN cd ${BUILD_BASE}/tools/rollup-http/echo-dapp && touch src/* && \ - cargo build --target riscv64gc-unknown-linux-gnu --release - -# pack tools (deb) +# build # ------------------------------------------------------------------------------ -FROM tools-env AS packer -ARG TOOLS_TARGZ=machine-emulator-tools.tar.gz -ARG STAGING_BASE=${BUILD_BASE}/_install - -COPY package.json ${STAGING_SHARE}/package.json -COPY copyright ${STAGING_BASE}/usr/share/doc/machine-emulator-tools/copyright - -RUN mkdir -p ${STAGING_BASE}/usr/bin ${STAGING_BASE}/usr/bin ${STAGING_BASE}/etc && \ - echo "cartesi-machine" > ${staging_base}/etc/hostname +FROM tools-env AS builder -COPY --from=c-builder ${BUILD_BASE}/tools/sys-utils_staging ${STAGING_BASE} -COPY --from=rust-builder ${BUILD_BASE}/tools/rollup-http/rollup-init/rollup-init ${STAGING_BASE}/usr/bin -COPY --from=http-server-builder ${BUILD_BASE}/tools/rollup-http/rollup-http-server/target/riscv64gc-unknown-linux-gnu/release/rollup-http-server ${STAGING_BASE}/usr/bin -COPY --from=echo-dapp-builder ${BUILD_BASE}/tools/rollup-http/echo-dapp/target/riscv64gc-unknown-linux-gnu/release/echo-dapp ${STAGING_BASE}/usr/bin +COPY . /work +WORKDIR /work -RUN cd ${STAGING_BASE} && tar -czf ${BUILD_BASE}/${TOOLS_TARGZ} * +RUN make -j$(nproc) -C sys-utils +RUN make -j$(nproc) -C rollup-http +RUN make install DESTDIR=$(pwd)/_install PREFIX=/usr +ARG TOOLS_TARGZ=machine-emulator-tools.tar.gz +RUN cd _install && tar -czf /work/${TOOLS_TARGZ} * diff --git a/Makefile b/Makefile index d17b713..6924d89 100644 --- a/Makefile +++ b/Makefile @@ -28,15 +28,25 @@ TOOLS_ROOTFS_IMAGE := cartesi/rootfs-tools:$(VERSION) IMAGE_KERNEL_VERSION ?= v0.20.0 LINUX_VERSION ?= 6.5.13-ctsi-1 LINUX_HEADERS_URLPATH := https://github.com/cartesi/image-kernel/releases/download/${IMAGE_KERNEL_VERSION}/linux-libc-dev-riscv64-cross-${LINUX_VERSION}-${IMAGE_KERNEL_VERSION}.deb +LINUX_HEADERS_SHA256 := 2723435e8b45d8fb7a79e9344f6dc517b3dbc08e03ac17baab311300ec475c08 -all: fs +PREFIX ?= /usr/local +DESTDIR ?= . +ARCH = $(shell uname -m) -build: package.json +ifeq ($(ARCH),riscv64) +all: sys-utils rollup-http package.json ## Build all tools from a riscv64 environment +else +all: targz fs +endif + +build: targz fs ## Build targz and fs (cross compiling with Docker) + +targz: ## Build tools .tar.gz (cross compiling with Docker) @docker buildx build --load \ --build-arg TOOLS_TARGZ=$(TOOLS_TARGZ) \ - --build-arg IMAGE_KERNEL_VERSION=$(IMAGE_KERNEL_VERSION) \ - --build-arg LINUX_VERSION=$(LINUX_VERSION) \ --build-arg LINUX_HEADERS_URLPATH=$(LINUX_HEADERS_URLPATH) \ + --build-arg LINUX_HEADERS_SHA256=$(LINUX_HEADERS_SHA256) \ -t $(TOOLS_IMAGE) \ -f Dockerfile \ . ; @@ -44,17 +54,15 @@ build: package.json copy: @ID=`docker create $(TOOLS_IMAGE)` && \ - docker cp $$ID:/opt/cartesi/$(TOOLS_TARGZ) . && \ + docker cp $$ID:/work/$(TOOLS_TARGZ) . && \ docker rm $$ID -$(TOOLS_TARGZ) targz: build - package.json: Makefile package.json.in @sed 's|ARG_VERSION|$(VERSION)|g' package.json.in > package.json -fs: $(TOOLS_ROOTFS) +fs: $(TOOLS_ROOTFS) ## Build tools rootfs image (cross compiling with Docker) -$(TOOLS_ROOTFS): $(TOOLS_TARGZ) +$(TOOLS_ROOTFS): $(TOOLS_TARGZ) fs/Dockerfile @docker buildx build --platform linux/riscv64 \ --build-arg TOOLS_TARGZ=$(TOOLS_TARGZ) \ --output type=tar,dest=rootfs.tar \ @@ -63,7 +71,7 @@ $(TOOLS_ROOTFS): $(TOOLS_TARGZ) xgenext2fs -fzB 4096 -i 4096 -r +4096 -a rootfs.tar -L rootfs $(TOOLS_ROOTFS) && \ rm -f rootfs.tar -fs-license: +fs-license: ## Build tools rootfs image HTML with license information @docker buildx build --load --platform linux/riscv64 \ --build-arg TOOLS_TARGZ=$(TOOLS_TARGZ) \ -t $(TOOLS_ROOTFS_IMAGE) \ @@ -71,7 +79,7 @@ fs-license: . TMPFILE=$$(mktemp) && (cd fs/third-party/repo-info/; ./scan-local.sh $(TOOLS_ROOTFS_IMAGE) linux/riscv64) | tee $$TMPFILE && pandoc -s -f markdown -t html5 -o $(TOOLS_ROOTFS).html $$TMPFILE && rm -f $$TMPFILE -env: +env: ## Print useful Makefile information @echo VERSION=$(VERSION) @echo TOOLS_TARGZ=$(TOOLS_TARGZ) @echo TOOLS_ROOTFS=$(TOOLS_ROOTFS) @@ -80,66 +88,65 @@ env: @echo IMAGE_KERNEL_VERSION=$(IMAGE_KERNEL_VERSION) @echo LINUX_VERSION=$(LINUX_VERSION) @echo LINUX_HEADERS_URLPATH=$(LINUX_HEADERS_URLPATH) + @echo LINUX_HEADERS_SHA256=$(LINUX_HEADERS_SHA256) -test: +test: ## Test tools using mock builds make -C sys-utils/libcmt/ test cd rollup-http/rollup-http-server && \ MOCK_BUILD=true cargo test -- --show-output --test-threads=1 -setup: +setup: ## Setup riscv64 buildx @docker run --privileged --rm linuxkit/binfmt:bebbae0c1100ebf7bf2ad4dfb9dfd719cf0ef132 -setup-required: +setup-required: ## Check if riscv64 buildx setup is required @echo 'riscv64 buildx setup required:' `docker buildx ls | grep -q riscv64 && echo no || echo yes` -build-tools-env: - docker build --target tools-env -t $(TOOLS_IMAGE)-tools-env -f Dockerfile . - -build-rust-builder-env: - docker build --target rust-builder -t $(TOOLS_IMAGE)-rust-builder -f Dockerfile . +image: ## Build tools cross compilation Docker image + docker build \ + --build-arg LINUX_HEADERS_URLPATH=$(LINUX_HEADERS_URLPATH) \ + --build-arg LINUX_HEADERS_SHA256=$(LINUX_HEADERS_SHA256) \ + --target tools-env -t $(TOOLS_IMAGE)-tools-env -f Dockerfile . -tools-env: +shell: ## Spawn a cross compilation shell with tools Docker image @docker run --hostname rust-builder -it --rm \ -e USER=$$(id -u -n) \ -e GROUP=$$(id -g -n) \ -e UID=$$(id -u) \ -e GID=$$(id -g) \ - -v `pwd`:/opt/cartesi/machine-emulator-tools \ - -w /opt/cartesi/machine-emulator-tools \ + -u $$(id -u):$$(id -g) \ + -v `pwd`:/work/machine-emulator-tools \ + -w /work/machine-emulator-tools \ $(TOOLS_IMAGE)-tools-env /bin/bash +sys-utils: ## Compile system utilities tools + @$(MAKE) -C $@ -rust-builder-env: - @docker run --hostname rust-builder -it --rm \ - -e USER=$$(id -u -n) \ - -e GROUP=$$(id -g -n) \ - -e UID=$$(id -u) \ - -e GID=$$(id -g) \ - -v `pwd`:/opt/cartesi/machine-emulator-tools \ - -w /opt/cartesi/machine-emulator-tools \ - $(TOOLS_IMAGE)-rust-builder /bin/bash +rollup-http: ## Compile rollup http tools + @$(MAKE) -C $@ -clean-image: +install-share: package.json + install -Dm644 package.json $(DESTDIR)$(PREFIX)/share/package.json + +install: install-share ## Install all tools into ${DESTDIR}/${PREFIX} + @$(MAKE) -C sys-utils/libcmt install + @$(MAKE) -C sys-utils install + @$(MAKE) -C rollup-http install + +clean-image: ## Clean docker images @(docker rmi $(TOOLS_IMAGE) > /dev/null 2>&1 || true) -clean: - @rm -f $(TOOLS_TARGZ) rootfs* +clean: ## Clean built files + @rm -f $(TOOLS_TARGZ) rootfs*.ext2 @$(MAKE) -C sys-utils clean + @$(MAKE) -C rollup-http clean -distclean: clean clean-image - -sys-utils: - @$(MAKE) -C sys-utils +distclean: clean clean-image ## Clean built files and docker images -help: - @echo 'available commands:' - @echo ' targz - build machine-emulator-tools .tar.gz' - @echo ' fs - build rootfs.ext2' - @echo ' fs-license - build rootfs.ext2.html with licence information' - @echo ' setup - setup riscv64 buildx' - @echo ' setup-required - check if riscv64 buildx setup is required' - @echo ' help - list makefile commands' - @echo ' env - print useful Makefile variables as a KEY=VALUE list' - @echo ' clean - remove the generated artifacts' +help: ## Show this help + @sed \ + -e '/^[a-zA-Z0-9_\-]*:.*##/!d' \ + -e 's/:.*##\s*/:/' \ + -e 's/^\(.\+\):\(.*\)/$(shell tput setaf 6)\1$(shell tput sgr0):\2/' \ + $(MAKEFILE_LIST) | column -c2 -t -s : -.PHONY: build fs fs-license targz env setup setup-required help distclean +.PHONY: all build targz fs fs-license env test setup setup-required image shell sys-utils rollup-http install clean-image clean distclean help diff --git a/README.md b/README.md index f32efee..60d1d44 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Cartesi Machine Emulator Tools -The Cartesi Machine Emulator Tools is a repository that contains a set of tools developed for the RISC-V Linux OS. It provides a RISC-V Debian package and a root filesystem for Ubuntu 22.04. +The Cartesi Machine Emulator Tools is a repository that contains a set of tools developed for the RISC-V Linux OS. It provides a RISC-V Debian package and a root filesystem for Ubuntu 24.04. ## Getting Started -Users looking to create cartesi-machine applications can use the provided Debian package and root filesystem directly from one of the prepackaged [releases](https://github.com/cartesi/machine-emulator-tools/releases), without needing to build this repository themselves. +Users looking to create cartesi-machine applications can use the provided Debian package and root filesystem directly from one of the prepackaged releases, without needing to build this repository themselves. ### Requirements @@ -20,26 +20,29 @@ To set up riscv64 buildx, use the following command: $ make setup ``` -### Building +### Building (from riscv64 environment) -Invoking make will build all tools and create the `machine-emulator-tools-$VERSION.tar.gz` archive along with the `rootfs-tools-$VERSION.ext2` root filesystem artifacts. +Assuming you are inside a riscv64 environment, you can build tools and install in the system with: -```bash -$ make +```sh +make +make install PREFIX=/usr/local ``` -#### Makefile targets +### Building (cross compiling) -The following commands are available as `make` targets: +In case you need to patch and develop tools, you can cross compile using Docker with: + +```sh +make build +``` + +This creates the `machine-emulator-tools-$VERSION.tar.gz` archive and the `rootfs-tools-$VERSION.ext2` root filesystem artifacts. +Both should only be use for testing and development purposes, not directly in dapps. + +#### Makefile targets -- **all**: Build Debian package and rootfs (Default) -- **targz**: Build machine-emulator-tools.tar.gz -- **fs**: Build rootfs.ext2 -- **setup**: Setup riscv64 buildx -- **setup-required**: Check if riscv64 buildx setup is required -- **help**: List Makefile commands -- **env**: Print useful Makefile variables as a KEY=VALUE list -- **clean**: Remove the generated artifacts +Check all targets available with `make help`. ## Contributing diff --git a/copyright b/copyright deleted file mode 100644 index 6e887f5..0000000 --- a/copyright +++ /dev/null @@ -1,23 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: machine-emulator-tools -Source: https://github.com/cartesi/machine-emulator-tools - -Files: * -Copyright: 2024 Individual contributors -License: Apache-2.0 - -License: Apache-2.0 - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - . - http://www.apache.org/licenses/LICENSE-2.0 - . - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - . - On Debian systems, the complete text of the Apache version 2.0 license - can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/rollup-http/Makefile b/rollup-http/Makefile new file mode 100644 index 0000000..4cebd76 --- /dev/null +++ b/rollup-http/Makefile @@ -0,0 +1,20 @@ +PREFIX?=/usr/local +CARGO_FLAGS+=--release +ARCH=$(shell uname -m) + +ifneq ($(ARCH),riscv64) +RUST_TARGET=--target riscv64gc-unknown-linux-gnu +endif + +all: + cd rollup-http-server && cargo build $(CARGO_FLAGS) $(RUST_TARGET) + cd echo-dapp && cargo build $(CARGO_FLAGS) $(RUST_TARGET) + +install: rollup-http-server echo-dapp + install -Dm755 rollup-http-server/target/riscv64*/release/rollup-http-server $(DESTDIR)$(PREFIX)/bin/rollup-http-server + install -Dm755 echo-dapp/target/riscv64*/release/echo-dapp $(DESTDIR)$(PREFIX)/bin/echo-dapp + +clean: + rm -rf rollup-http-server/target echo-dapp/target + +.PHONY: all install clean diff --git a/rollup-http/rollup-http-server/Cargo.lock b/rollup-http/rollup-http-server/Cargo.lock index a9c31a9..b412406 100644 --- a/rollup-http/rollup-http-server/Cargo.lock +++ b/rollup-http/rollup-http-server/Cargo.lock @@ -136,43 +136,6 @@ name = "actix-web" version = "4.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9180d76e5cc7ccbc4d60a506f2c727730b154010262df5b910eb17dbe4b8cb38" -dependencies = [ - "actix-codec", - "actix-http", - "actix-router", - "actix-rt", - "actix-server", - "actix-service", - "actix-utils", - "ahash", - "bytes", - "bytestring", - "cfg-if", - "derive_more", - "encoding_rs", - "futures-core", - "futures-util", - "impl-more", - "itoa", - "language-tags", - "log", - "mime", - "once_cell", - "pin-project-lite", - "regex-lite", - "serde", - "serde_json", - "serde_urlencoded", - "smallvec", - "socket2", - "time", - "url", -] - -[[package]] -name = "actix-web" -version = "4.9.0" -source = "git+https://github.com/actix/actix-web?tag=web-v4.9.0#e0918fb1795c899ac38fb903694ca1aa3b58d46d" dependencies = [ "actix-codec", "actix-http", @@ -230,7 +193,7 @@ checksum = "0f65804955af25ad36225100983ec8d92f14795e7f8080073f8147d0b768c78e" dependencies = [ "actix-http", "actix-router", - "actix-web 4.9.0 (git+https://github.com/actix/actix-web?tag=web-v4.9.0#e0918fb1795c899ac38fb903694ca1aa3b58d46d)", + "actix-web", "bytes", "futures", "futures-util", @@ -1600,11 +1563,10 @@ name = "rollup-http-server" version = "0.2.0" dependencies = [ "actix-server", - "actix-web 4.9.0 (git+https://github.com/actix/actix-web?tag=web-v4.9.0)", + "actix-web", "actix-web-validator", "async-mutex", "bindgen", - "derive_more", "env_logger 0.11.5", "ethabi", "getopts", @@ -1736,7 +1698,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" dependencies = [ - "actix-web 4.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-web", "futures", "percent-encoding", "serde", diff --git a/sys-utils/Makefile b/sys-utils/Makefile index 52ac5f5..42d908d 100644 --- a/sys-utils/Makefile +++ b/sys-utils/Makefile @@ -14,19 +14,22 @@ # limitations under the License. # -UTILITIES := libcmt hex xhalt yield rollup ioctl-echo-loop misc cartesi-init +UTILITIES := hex xhalt yield rollup ioctl-echo-loop misc cartesi-init + +PREFIX ?= /usr/local +DESTDIR ?= all: @$(MAKE) libcmt @$(MAKE) $(UTILITIES) -$(UTILITIES): +libcmt $(UTILITIES): @$(MAKE) -C $@ install: @$(foreach utility,$(UTILITIES),$(MAKE) -C $(utility) install;) clean: - @$(foreach utility,$(UTILITIES),$(MAKE) -C $(utility) clean;) + @$(foreach utility,$(UTILITIES) libcmt,$(MAKE) -C $(utility) clean;) -.PHONY: all install clean $(UTILITIES) +.PHONY: all libcmt $(UTILITIES) install clean diff --git a/sys-utils/cartesi-init/Makefile b/sys-utils/cartesi-init/Makefile index c60b633..bc104e0 100644 --- a/sys-utils/cartesi-init/Makefile +++ b/sys-utils/cartesi-init/Makefile @@ -3,7 +3,6 @@ PREFIX = /usr/local all: ; install: - mkdir -p $(DESTDIR)$(PREFIX)/sbin - install -Dm755 cartesi-init $(DESTDIR)$(PREFIX)/sbin/ + install -Dm755 cartesi-init $(DESTDIR)$(PREFIX)/sbin/cartesi-init clean: ; diff --git a/sys-utils/hex/Makefile b/sys-utils/hex/Makefile index 47dabe5..d5c969b 100644 --- a/sys-utils/hex/Makefile +++ b/sys-utils/hex/Makefile @@ -24,8 +24,7 @@ hex: hex.cpp $(CXX) $(CFLAGS) -o $@ $< $(LDFLAGS) install: hex - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -Dm755 hex $(DESTDIR)$(PREFIX)/bin/ + install -Dm755 hex $(DESTDIR)$(PREFIX)/bin/hex clean: @rm -f hex diff --git a/sys-utils/ioctl-echo-loop/Makefile b/sys-utils/ioctl-echo-loop/Makefile index 138b60c..7c3738a 100644 --- a/sys-utils/ioctl-echo-loop/Makefile +++ b/sys-utils/ioctl-echo-loop/Makefile @@ -25,8 +25,7 @@ ioctl-echo-loop: ioctl-echo-loop.c $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) install: ioctl-echo-loop - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -Dm755 ioctl-echo-loop $(DESTDIR)$(PREFIX)/bin/ + install -Dm755 ioctl-echo-loop $(DESTDIR)$(PREFIX)/bin/ioctl-echo-loop clean: @rm -f ioctl-echo-loop diff --git a/sys-utils/rollup/Makefile b/sys-utils/rollup/Makefile index f059cb7..3a20ce5 100644 --- a/sys-utils/rollup/Makefile +++ b/sys-utils/rollup/Makefile @@ -25,8 +25,7 @@ rollup: rollup.cpp $(CXX) $(CXXFLAGS) -o $@ $< $(LDFLAGS) install: rollup - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -Dm755 rollup $(DESTDIR)$(PREFIX)/bin/ + install -Dm755 rollup $(DESTDIR)$(PREFIX)/bin/rollup clean: @rm -f rollup diff --git a/sys-utils/xhalt/Makefile b/sys-utils/xhalt/Makefile index 1aa7c06..9b79efc 100644 --- a/sys-utils/xhalt/Makefile +++ b/sys-utils/xhalt/Makefile @@ -24,8 +24,7 @@ xhalt: xhalt.c $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) install: xhalt - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -Dm755 xhalt $(DESTDIR)$(PREFIX)/bin/ + install -Dm755 xhalt $(DESTDIR)$(PREFIX)/bin/xhalt clean: @rm -f xhalt diff --git a/sys-utils/yield/Makefile b/sys-utils/yield/Makefile index 3f943e3..c4f9933 100644 --- a/sys-utils/yield/Makefile +++ b/sys-utils/yield/Makefile @@ -25,8 +25,7 @@ yield: yield.c $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) install: yield - mkdir -p $(DESTDIR)$(PREFIX)/bin - install -Dm755 yield $(DESTDIR)$(PREFIX)/bin/ + install -Dm755 yield $(DESTDIR)$(PREFIX)/bin/yield clean: @rm -f yield