mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
committed by
Christian Helmuth
parent
f78d856b37
commit
51722c1fe6
@@ -15,7 +15,7 @@ help:
|
||||
@$(ECHO) "install - copy Nim compiler and standard library to '$(INSTALL_LOCATION)'"
|
||||
@$(ECHO)
|
||||
|
||||
.PHONY: build help install
|
||||
.PHONY: help install
|
||||
|
||||
GENODE_DIR ?= $(realpath $(dir $(firstword $(MAKEFILE_LIST)))/..)
|
||||
include $(GENODE_DIR)/tool/ports/mk/common.inc
|
||||
@@ -24,31 +24,31 @@ LOCAL_INSTALL_LOCATION ?= /usr/local
|
||||
INSTALL_LOCATION := $(LOCAL_INSTALL_LOCATION)/genode-nim
|
||||
|
||||
NIM_CONTRIB_DIR = $(shell $(GENODE_DIR)/tool/ports/current nim)
|
||||
NIM_CSOURCES_CONTRIB_DIR = $(shell $(GENODE_DIR)/tool/ports/current nim-csources)
|
||||
|
||||
BUILD_DIR = build/nim
|
||||
|
||||
install: build
|
||||
@$(ECHO) "$(BRIGHT_COL)installing Nim to '$(INSTALL_LOCATION)'...$(DEFAULT_COL)"
|
||||
$(VERBOSE)sudo rm -rf $(INSTALL_LOCATION)
|
||||
$(VERBOSE)sudo mkdir -p $(INSTALL_LOCATION)
|
||||
$(VERBOSE)sudo cp -a $(BUILD_DIR)/* $(INSTALL_LOCATION)
|
||||
|
||||
build: $(BUILD_DIR)/bin/nim $(BUILD_DIR)/koch
|
||||
|
||||
$(BUILD_DIR)/bin/nim: $(BUILD_DIR)/koch
|
||||
@$(ECHO) "$(BRIGHT_COL)building Nim compiler...$(DEFAULT_COL)"
|
||||
$(VERBOSE)cd $(BUILD_DIR) && ./koch boot -d:release --verbosity:0 --hint[Processing]:off
|
||||
|
||||
$(BUILD_DIR)/koch: $(BUILD_DIR)/koch.nim $(BUILD_DIR)/.bootstrap.tag
|
||||
$(BUILD_DIR)/koch: $(BUILD_DIR)/.bootstrap.tag
|
||||
@$(ECHO) "$(BRIGHT_COL)building Koch...$(DEFAULT_COL)"
|
||||
$(VERBOSE)cd $(BUILD_DIR) && ./bin/nim c koch
|
||||
|
||||
$(BUILD_DIR)/.bootstrap.tag: $(BUILD_DIR)/csources
|
||||
$(BUILD_DIR)/.bootstrap.tag: $(BUILD_DIR)/build.sh
|
||||
@$(ECHO) "$(BRIGHT_COL)building bootstrap compiler...$(DEFAULT_COL)"
|
||||
$(VERBOSE)cd $(BUILD_DIR)/csources && sh build.sh
|
||||
$(VERBOSE)cd $(BUILD_DIR) && sh build.sh
|
||||
@touch $@
|
||||
|
||||
$(BUILD_DIR)/csources: $(NIM_CSOURCES_CONTRIB_DIR) $(BUILD_DIR)/koch.nim
|
||||
@$(ECHO) "$(BRIGHT_COL)copying Nim C sources...$(DEFAULT_COL)"
|
||||
$(VERBOSE)mkdir -p $@
|
||||
$(VERBOSE)cp -a $</* $@
|
||||
|
||||
$(BUILD_DIR)/koch.nim: $(NIM_CONTRIB_DIR)
|
||||
$(BUILD_DIR)/build.sh: $(NIM_CONTRIB_DIR)
|
||||
@$(ECHO) "$(BRIGHT_COL)copying Nim sources...$(DEFAULT_COL)"
|
||||
$(VERBOSE)mkdir -p $(BUILD_DIR)
|
||||
$(VERBOSE)cp -a $</* $(BUILD_DIR)
|
||||
@@ -57,17 +57,5 @@ $(NIM_CONTRIB_DIR):
|
||||
@$(ECHO) "$(BRIGHT_COL)preparing Nim...$(DEFAULT_COL)"
|
||||
$(VERBOSE)$(GENODE_DIR)/tool/ports/prepare_port nim
|
||||
|
||||
$(NIM_CSOURCES_CONTRIB_DIR):
|
||||
@$(ECHO) "$(BRIGHT_COL)preparing Nim C sources...$(DEFAULT_COL)"
|
||||
$(VERBOSE)$(GENODE_DIR)/tool/ports/prepare_port nim-csources
|
||||
|
||||
copy: build
|
||||
@$(ECHO) "$(BRIGHT_COL)installing Nim to '$(INSTALL_LOCATION)'...$(DEFAULT_COL)"
|
||||
$(VERBOSE)rm -r $(BUILD_DIR)/csources
|
||||
$(VERBOSE)sudo mkdir -p $(INSTALL_LOCATION)
|
||||
$(VERBOSE)sudo cp -a $(BUILD_DIR)/* $(INSTALL_LOCATION)
|
||||
|
||||
install: copy
|
||||
|
||||
clean:
|
||||
$(VERBOSE)rm -rf $(BUILD_DIR)
|
||||
|
||||
Reference in New Issue
Block a user