Skip to content

Commit

Permalink
Updated disk object from assets to client.
Browse files Browse the repository at this point in the history
████ ███  To request new features or in case this commit breaks something for you,
████ ███  please, create a new github issue with all possible information for me,
▓███▀█▄   but never share your API Keys!
▒▓██ ███
░▒▓█ ███  Signed-off-by: Carles Tubio <[email protected]>
 _________________________________________
/ Hello, WORLD!                           \
|                                         |
\ pssst.. 1.00000000 BTC = 48811.12 EUR.  /
 -----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
  • Loading branch information
ctubio committed Oct 11, 2021
1 parent f723d6a commit 1db9788
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
38 changes: 15 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,19 @@ KARGS := -std=c++20 -O3 -pthread \
-I$(KBUILD)/include \
$(addprefix $(KBUILD)/lib/, \
K-$(KHOST).$(ABI).a \
libsqlite3.a \
libcurl.a \
libssl.a libcrypto.a \
libz.a \
libsqlite3.a libcurl.a libssl.a libcrypto.a libz.a \
) \
$(wildcard $(addprefix $(KBUILD)/lib/, \
K-$(KSRC)-assets.o \
K-$(KSRC)-client.o \
libuv.a \
)) \
$(addprefix -include , \
$(realpath src/bin/$(KSRC)/$(KSRC).disk.S) \
$(addprefix src/lib/Krypto.ninja-, \
$(addsuffix .S, \
disk \
) \
$(addsuffix .h, \
lang \
data \
apis \
bots \
))) \
$(addsuffix .S, disk) \
$(addsuffix .h, lang data apis bots) \
) \
) \
-D'DEBUG_FRAMEWORK="Krypto.ninja-test.h"' \
-D'DEBUG_SCENARIOS=<$(or \
$(realpath src/bin/$(KSRC)/$(KSRC).test.h), \
Expand Down Expand Up @@ -139,21 +131,21 @@ endif

$(SOURCE):
$(info $(call STEP,$@))
$(MAKE) $(shell ! test -d src/bin/$@/$@.client || echo assets) src KSRC=$@
$(MAKE) $(shell ! test -d src/bin/$@/$@.client || echo client) src KSRC=$@

assets: src/bin/$(KSRC)/$(KSRC).client
client: src/bin/$(KSRC)/$(KSRC).client
$(info $(call STEP,$(KSRC) $@))
$(MAKE) -C src/lib/Krypto.ninja-client KHOME=$(KHOME) KCLIENT=$(realpath $<)
$(foreach chost,$(CARCH), \
build=build-$(shell echo $(chost) | sed 's/-\([a-z_0-9]*\)-\(linux\)$$/-\2-\1/' | sed 's/\([a-z_0-9]*\)-\([a-z_0-9]*\)-.*/\2-\1/' | sed 's/^w64/win64/') \
&& ! test -d $${build} || (rm -rf $${build}/var/assets && cp -R $(KHOME)/assets $${build}/var/assets \
&& $(MAKE) assets.o CHOST=$(chost) chost=$(shell test -n "`command -v $(chost)-g++`" && echo $(chost)- || :) \
&& rm -rf $${build}/var/assets) \
&& ! test -d $${build} || (rm -rf $${build}/var/client && cp -R $(KHOME)/client $${build}/var/client \
&& $(MAKE) client.o CHOST=$(chost) chost=$(shell test -n "`command -v $(chost)-g++`" && echo $(chost)- || :) \
&& rm -rf $${build}/var/client) \
;)
rm -rf $(KHOME)/assets
rm -rf $(KHOME)/client

assets.o: src/bin/$(KSRC)/$(KSRC).disk.S
$(chost)g++ -Wa,-I,$(KBUILD)/var/assets,-I,src/lib/Krypto.ninja-client \
client.o: src/bin/$(KSRC)/$(KSRC).disk.S
$(chost)g++ -Wa,-I,$(KBUILD)/var/client,-I,src/lib/Krypto.ninja-client \
-include $^ -c src/lib/Krypto.ninja-disk.S -o $(KBUILD)/lib/K-$(KSRC)-$@

src: src/lib/Krypto.ninja-main.cxx src/bin/$(KSRC)/$(KSRC).main.h
Expand Down Expand Up @@ -365,4 +357,4 @@ md5: src
asandwich:
@test "`whoami`" = "root" && echo OK || echo make it yourself!

.PHONY: all K $(SOURCE) hlep hepl help doc test src assets assets.o clean check lib download cleandb screen-help list screen start stop restart startall stopall restartall packages system_install uninstall install docker reinstall diff upgrade changelog test-c push MAJOR MINOR PATCH BUILD release md5 symbol_encode_src symbol_decode_src symbol_encode_Darwin symbol_decode_Darwin asandwich
.PHONY: all K $(SOURCE) hlep hepl help doc test src client client.o clean check lib download cleandb screen-help list screen start stop restart startall stopall restartall packages system_install uninstall install docker reinstall diff upgrade changelog test-c push MAJOR MINOR PATCH BUILD release md5 symbol_encode_src symbol_decode_src symbol_encode_Darwin symbol_decode_Darwin asandwich
2 changes: 1 addition & 1 deletion src/bin/+portfolios/+portfolios.disk.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! \note See src/lib/Krypto.ninja-disk.S for info about DISK()
//! \note Webserver 404 page is loaded using an empty url path.
//! \note Filesystem paths at www/* are included from lib/, at:
//! - /var/lib/K/assets/www/*
//! - /var/lib/K/client/www/*
//! - ./src/lib/Krypto.ninja-client/www/*

#define DISK(file) \
Expand Down
2 changes: 1 addition & 1 deletion src/bin/trading-bot/trading-bot.disk.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! \note See src/lib/Krypto.ninja-disk.S for info about DISK()
//! \note Webserver 404 page is loaded using an empty url path.
//! \note Filesystem paths at www/* are included from lib/, at:
//! - /var/lib/K/assets/www/*
//! - /var/lib/K/client/www/*
//! - ./src/lib/Krypto.ninja-client/www/*

#define DISK(file) \
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Krypto.ninja-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ERR = *** Unexpected MAKE_VERSION < 4.
HINT = This Makefile can't be used with your make v${MAKE_VERSION}, consider to upgrade before try again
$(if $(shell ver=${MAKE_VERSION} && test $${ver%%.*} -lt 4 && echo 1),$(warning $(ERR));$(error $(HINT)))

KASSETS = $(KHOME)/assets/www
KASSETS = $(KHOME)/client/www
NODE_PATH = $(KHOME)/node_modules
PATH := $(NODE_PATH)/.bin:$(PATH)

Expand Down

0 comments on commit 1db9788

Please sign in to comment.