Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
JerrySievert committed Nov 6, 2024
1 parent 1dca13d commit 238b9b0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
32 changes: 32 additions & 0 deletions META.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "pljs",
"abstract": "Javascript language extension for PostgreSQL",
"description": "This is the Javascript language extension for PostgreSQL, providing the ability to run Javascript functions and procedures inside of PostgreSQL.",
"version": "0.8.1",
"maintainer": ["Jerry Sievert <[email protected]>"],
"license": "postgresql",
"provides": {
"pljs": {
"abstract": "Javascript language extension for PostgreSQL",
"file": "pljs.sql",
"docfile": "README.md",
"version": "0.8.1"
}
},
"resources": {
"bugtracker": {
"web": "https://github.com/plv8/pljs/issues/"
},
"repository": {
"url": "git://github.com/plv8/pljs.git",
"web": "https://github.com/plv8/pljs/",
"type": "git"
}
},
"generated_by": "Jerry Sievert",
"meta-spec": {
"version": "1.0.0",
"url": "https://pgxn.org/meta/spec.txt"
},
"tags": ["language", "javascript", "ecmascript", "js", "plv8", "quickjs"]
}
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ INCLUDEDIR_SERVER := ${shell $(PG_CONFIG) --includedir-server}

CP = cp
SRCS = src/pljs.c src/cache.c src/functions.c src/types.c src/params.c
OBJS = deps/quickjs/libquickjs.a src/pljs.o src/cache.o src/functions.o src/types.o src/params.o
OBJS = src/pljs.o src/cache.o src/functions.o src/types.o src/params.o deps/quickjs/libquickjs.a
MODULE_big = pljs
EXTENSION = pljs
DATA = pljs.control pljs--$(PLJS_VERSION).sql
Expand All @@ -21,20 +21,20 @@ REGRESS = init-extension function json jsonb json_conv types bytea context \
cursor array_spread plv8_regressions memory_limits inline composites \
trigger procedure find_function

all: deps/quickjs/libquickjs.a pljs--$(PLJS_VERSION).sql


include $(PGXS)


all: pljs--$(PLJS_VERSION).sql

deps/quickjs/libquickjs.a:
deps/quickjs/quickjs.h:
mkdir -p deps
git submodule update --init --recursive
patch -p1 <patches/01-shared-lib-build
cd deps/quickjs && make libquickjs.a

deps/quickjs/quickjs.h: deps/quickjs/libquickjs.a
deps/quickjs/libquickjs.a:
cd deps/quickjs && make

format:
clang-format -i $(SRCS) src/pljs.h
Expand All @@ -47,10 +47,11 @@ lintcheck:

.depend: deps/quickjs/quickjs.h
$(RM) -f .depend
$(foreach SRC,$(SRCS),$(CC) $(CFLAGS) -I$(INCLUDEDIR) -I$(INCLUDEDIR_SERVER) \
$(foreach SRC,$(SRCS),$(CC) $(PG_CFLAGS) -I$(INCLUDEDIR) -I$(INCLUDEDIR_SERVER) \
-I$(PWD) -MM -MT $(SRC:.c=.o) $(SRC) >> .depend;)


all: deps/quickjs/libquickjs.a pljs--$(PLJS_VERSION).sql

clean: cleandepend cleansql

Expand Down

0 comments on commit 238b9b0

Please sign in to comment.