sdk: added compilation of `sjasmplus` on GNU/Linux

This commit is contained in:
Ivan Tatarinov 2021-04-08 13:41:02 +03:00
parent 4196b86c51
commit 674cf174c7
5 changed files with 97 additions and 0 deletions

3
.gitignore vendored
View File

@ -53,3 +53,6 @@ cores/Oric/source/_impact.cmd
cores/Oric/source/_impact.log
cores/Oric/build/oric.v4_my.bit
sdk/bin/sjasmplus
sdk/src/sjasmplus

24
sdk/Makefile Normal file
View File

@ -0,0 +1,24 @@
# Supported environments:
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
include common.mk
ifeq ($(OS),Windows_NT)
SJASMPLUS := sjasmplus.exe
else
SJASMPLUS := sjasmplus
endif
TOOLS:=\
bin/$(SJASMPLUS)
.PHONY: all
all: $(TOOLS)
$(TOOLS): | src/Makefile
$(MAKE) -w -C src ../bin/$(@F)
.PHONY: clean
clean: | src/Makefile
$(MAKE) -w -C src clean

View File

@ -4,4 +4,12 @@
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
ifndef ZXUNOSDK
ZXUNOSDK := $(patsubst %/,%,$(abspath $(dir $(lastword $(MAKEFILE_LIST)))))
PATH := $(ZXUNOSDK)/bin:$(PATH)
export ZXUNOSDK
export PATH
endif

35
sdk/src/Makefile Normal file
View File

@ -0,0 +1,35 @@
# Supported environments:
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
include ../common.mk
ifeq ($(OS),Windows_NT)
SJASMPLUS := sjasmplus.exe
else
SJASMPLUS := sjasmplus
endif
.PHONY: all
all: \
../bin/$(SJASMPLUS)
ifneq ($(OS),Windows_NT)
../bin/$(SJASMPLUS): sjasmplus/build/$(SJASMPLUS)
cp $< $@
sjasmplus/build/$(SJASMPLUS): | sjasmplus sjasmplus.mk
$(MAKE) -w -C sjasmplus -f ../sjasmplus.mk
sjasmplus:
git clone https://github.com/sjasmplus/sjasmplus.git $@
endif
.PHONY: clean
ifeq ($(OS),Windows_NT)
clean:;
else
clean: | sjasmplus sjasmplus.mk
$(MAKE) -w -C sjasmplus -f ../sjasmplus.mk clean
rm -f ../bin/$(SJASMPLUS)
endif

27
sdk/src/sjasmplus.mk Normal file
View File

@ -0,0 +1,27 @@
# Build:
# make -w -C sjasmplus -f ../sjasmplus.mk
# Clean:
# make -w -C sjasmplus -f ../sjasmplus.mk clean
#
# Supported environments:
# * GNU/Linux
# * Windows NT (using MinGW/MSYS/Cygwin/WSL)
ifeq ($(OS),Windows_NT)
SJASMPLUS := sjasmplus.exe
else
SJASMPLUS := sjasmplus
endif
build/$(SJASMPLUS): | build/Makefile
$(MAKE) -w -C build
build/Makefile: | build
cd build && cmake ..
build:
mkdir -p build
.PHONY: clean
clean: | build/Makefile
$(MAKE) -w -C build clean