This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch make_targets
in repository https://gitbox.apache.org/repos/asf/datasketches-bigquery.git


The following commit(s) were added to refs/heads/make_targets by this push:
     new a2b3cd6  better make targets
a2b3cd6 is described below

commit a2b3cd65ac231162965de9b7c5d2b8a80f5f542a
Author: AlexanderSaydakov <[email protected]>
AuthorDate: Mon Mar 10 16:50:14 2025 -0700

    better make targets
---
 Makefile         | 24 +++++++++++++++++++-----
 README.md        | 21 ++++++++++++---------
 cpc/Makefile     |  2 +-
 fi/Makefile      |  2 +-
 hll/Makefile     |  2 +-
 kll/Makefile     |  2 +-
 req/Makefile     |  2 +-
 tdigest/Makefile |  2 +-
 theta/Makefile   |  2 +-
 tuple/Makefile   |  2 +-
 10 files changed, 39 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index d82568a..69f474d 100644
--- a/Makefile
+++ b/Makefile
@@ -47,23 +47,37 @@ clean: $(MODCLEAN)
 init:
        (cd cicd && ./init_dataform.sh)
 
+MODUPLOAD = $(addsuffix .upload, $(MODULES))
+
+$(MODUPLOAD): %.upload:
+       $(MAKE) -C $* upload
+
+upload: $(MODUPLOAD)
+
+MODCREATE = $(addsuffix .create, $(MODULES))
+
+$(MODCREATE): %.create:
+       $(MAKE) -C $* create
+
+create: init
+       dataform run --tags "udfs"
+
 MODINSTALL = $(addsuffix .install, $(MODULES))
 
 $(MODINSTALL): %.install:
        $(MAKE) -C $* install
 
-install: init $(MODINSTALL)
-       dataform run --tags "udfs"
+install: upload create
 
 MODTEST = $(addsuffix .test, $(MODULES))
 
 $(MODTEST): %.test:
        - $(MAKE) -C $* test
 
-unittest:
+test: init
        dataform test
 
-test: $(MODTEST) unittest
-
 readme:
        python3 readme_generator.py
+
+.PHONY: all clean init install upload create
diff --git a/README.md b/README.md
index bfd3485..ecc0fb1 100644
--- a/README.md
+++ b/README.md
@@ -108,21 +108,24 @@ Run the following steps in this repo's root directory to 
install everything:
 
 ```bash
 gcloud auth application-default login # for authentication
-make          # performs compilation
-make install  # upload to $JS_BUCKET & create functions in 
$BQ_PROJECT.$BQ_DATASET
-make test     # runs predefined tests in BQ
+make          # compile C++ code and produce .js, .mjs and .wasm artifacts
+make install  # upload artifacts to $JS_BUCKET and create SQLX functions in 
$BQ_PROJECT.$BQ_DATASET
+make test     # run tests in BigQuery
 ```
 
+The "install" target consists of "upload" and "create", which can be used 
separately if desired
+
 ### Install Specific DataSketches
 
-To install a specific sketch, change into an individual sketch directory and 
run
-the following:
+To install a specific sketch use rargets or the form dir.target.
+For example, to install Theta sketch only:
 
 ```bash
 gcloud auth application-default login # for authentication
-make          # performs compilation
-make install  # upload to $JS_BUCKET 
-make create   # create functions in $BQ_PROJECT.$BQ_DATASET
+make theta          # compile C++ code and produce .js, .mjs and .wasm 
artifacts
+make theta.install  # upload artifacts to $JS_BUCKET and create SQLX functions 
in $BQ_PROJECT.$BQ_DATASET
 ```
 
-</details>
\ No newline at end of file
+Currently there is no way to run tests for a specific sketch only. "make 
example" can be used in an individual sketch directory.
+
+</details>
diff --git a/cpc/Makefile b/cpc/Makefile
index 7fb9ff2..70f093e 100644
--- a/cpc/Makefile
+++ b/cpc/Makefile
@@ -55,7 +55,7 @@ reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 
2,$(words $(1)),$(
 create:
        cd .. && dataform run --tags "cpc"
 
-install: upload
+install: upload create
 
 example:
        @for file in $(wildcard test/*sql); do \
diff --git a/fi/Makefile b/fi/Makefile
index 92202d5..ec01824 100644
--- a/fi/Makefile
+++ b/fi/Makefile
@@ -55,7 +55,7 @@ reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 
2,$(words $(1)),$(
 create:
        cd .. && dataform run --tags "fi"
 
-install: upload
+install: upload create
 
 example:
        @for file in $(wildcard test/*sql); do \
diff --git a/hll/Makefile b/hll/Makefile
index d68815b..98383b4 100644
--- a/hll/Makefile
+++ b/hll/Makefile
@@ -55,7 +55,7 @@ reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 
2,$(words $(1)),$(
 create:
        cd .. && dataform run --tags "hll"
 
-install: upload
+install: upload create
 
 example:
        @for file in $(wildcard test/*sql); do \
diff --git a/kll/Makefile b/kll/Makefile
index 9ec2e8a..32519be 100644
--- a/kll/Makefile
+++ b/kll/Makefile
@@ -56,7 +56,7 @@ reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 
2,$(words $(1)),$(
 create:
        cd .. && dataform run --tags "kll"
 
-install: upload
+install: upload create
 
 example:
        @for file in $(wildcard test/*sql); do \
diff --git a/req/Makefile b/req/Makefile
index b07e7af..f068685 100644
--- a/req/Makefile
+++ b/req/Makefile
@@ -52,7 +52,7 @@ upload: all
 create:
        cd .. && dataform run --tags req
 
-install: upload
+install: upload create
 
 example:
        @for file in $(wildcard test/*sql); do \
diff --git a/tdigest/Makefile b/tdigest/Makefile
index 1ae8dff..9041228 100644
--- a/tdigest/Makefile
+++ b/tdigest/Makefile
@@ -55,7 +55,7 @@ reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 
2,$(words $(1)),$(
 create:
        cd .. && dataform run --tags "tdigest"
 
-install: upload
+install: upload create
 
 example:
        @for file in $(wildcard test/*sql); do \
diff --git a/theta/Makefile b/theta/Makefile
index 997b4cb..e5c2e36 100644
--- a/theta/Makefile
+++ b/theta/Makefile
@@ -55,7 +55,7 @@ reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 
2,$(words $(1)),$(
 create:
        cd .. && dataform run --tags "theta"
 
-install: upload
+install: upload create
 
 example:
        @for file in $(wildcard test/*sql); do \
diff --git a/tuple/Makefile b/tuple/Makefile
index 3d709d7..2d76857 100644
--- a/tuple/Makefile
+++ b/tuple/Makefile
@@ -56,7 +56,7 @@ reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 
2,$(words $(1)),$(
 create:
        cd .. && dataform run --tags "tuple"
 
-install: upload
+install: upload create
 
 example:
        @for file in $(wildcard test/*sql); do \


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to