Skip to content

Commit

Permalink
Update Makefile for easier linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
JerrySievert committed Nov 8, 2024
1 parent 53e6388 commit e3c5c80
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: lintcheck format cleandepend cleansql docs clean test all
.PHONY: lintcheck format cleansql docs clean test all

PLJS_VERSION = 0.8.1

Expand All @@ -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 = src/pljs.o src/cache.o src/functions.o src/types.o src/params.o deps/quickjs/libquickjs.a
OBJS = src/pljs.o src/cache.o src/functions.o src/types.o src/params.o
MODULE_big = pljs
EXTENSION = pljs
DATA = pljs.control pljs--$(PLJS_VERSION).sql
Expand All @@ -21,19 +21,18 @@ 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

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

include $(PGXS)


src/pljs.o: deps/quickjs/libquickjs.a

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

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

format:
Expand All @@ -45,23 +44,12 @@ pljs--$(PLJS_VERSION).sql: pljs.sql
lintcheck:
clang-tidy $(SRCS) -- -I$(INCLUDEDIR) -I$(INCLUDEDIR_SERVER) -I$(PWD) --std=c11

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

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

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

clean: cleandepend cleansql

cleandepend:
$(RM) -f .depend
clean: cleansql

cleansql:
$(RM) -f pljs--$(PLJS_VERSION).sql

docs:
doxygen src/Doxyfile

include .depend

0 comments on commit e3c5c80

Please sign in to comment.