Skip to content

Commit e4f45ac

Browse files
committed
Updated git ignore
1 parent 64d6d82 commit e4f45ac

32 files changed

+271124
-108
lines changed

.gitignore

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
*.exe
2-
*.exe~
2+
*~
33
*.dll
44
*.so
55
*.dylib
66
*.test
77
*.out
88
*.pb.go
9+
*.o
10+
*.a
911
.vscode
1012
.DS_Store
1113

12-
# Build files
13-
build
14+
# folders
15+
build/
16+
dist/
17+
node_modules/
1418

15-
# sqlie files
19+
# sqlite files
1620
.sqlite
1721
.sqlite-journal
18-
19-
# NPM ignores
20-
dist/
21-
node_modules/

Makefile

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Paths to packages
22
GO=$(shell which go)
3-
NPM=$(shell which npm)
43

54
# Paths to locations, etc
6-
BUILD_DIR := "build"
5+
BUILD_DIR := build
76
PLUGIN_DIR := $(wildcard plugin/*)
8-
NPM_DIR := $(wildcard npm/*)
97
CMD_DIR := $(filter-out cmd/README.md, $(wildcard cmd/*))
8+
SQLITE_DIR := ./c
109

1110
# Build flags
1211
BUILD_MODULE = "github.com/mutablelogic/go-sqlite"
@@ -15,32 +14,26 @@ BUILD_LD_FLAGS += -X $(BUILD_MODULE)/pkg/config.GitTag=$(shell git describe --ta
1514
BUILD_LD_FLAGS += -X $(BUILD_MODULE)/pkg/config.GitBranch=$(shell git name-rev HEAD --name-only --always)
1615
BUILD_LD_FLAGS += -X $(BUILD_MODULE)/pkg/config.GitHash=$(shell git rev-parse HEAD)
1716
BUILD_LD_FLAGS += -X $(BUILD_MODULE)/pkg/config.GoBuildTime=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
18-
BUILD_FLAGS = -ldflags "-s -w $(BUILD_LD_FLAGS)"
17+
BUILD_FLAGS = -ldflags "-s -w ${BUILD_LD_FLAGS}"
1918
BUILD_VERSION = $(shell git describe --tags)
2019
BUILD_ARCH = $(shell $(GO) env GOARCH)
2120
BUILD_PLATFORM = $(shell $(GO) env GOOS)
2221

23-
all: clean server plugins npm cmd
22+
all: clean server plugins cmd
2423

25-
server: dependencies mkdir
24+
server: dependencies
2625
@echo Build server
2726
@${GO} build -o ${BUILD_DIR}/server ${BUILD_FLAGS} github.com/mutablelogic/go-server/cmd/server
2827

29-
plugins: $(PLUGIN_DIR)
28+
plugins: dependencies $(PLUGIN_DIR)
3029
@echo Build plugin httpserver
3130
@${GO} build -buildmode=plugin -o ${BUILD_DIR}/httpserver.plugin ${BUILD_FLAGS} github.com/mutablelogic/go-server/plugin/httpserver
3231
@echo Build plugin log
3332
@${GO} build -buildmode=plugin -o ${BUILD_DIR}/log.plugin ${BUILD_FLAGS} github.com/mutablelogic/go-server/plugin/log
3433
@echo Build plugin static
3534
@${GO} build -buildmode=plugin -o ${BUILD_DIR}/static.plugin ${BUILD_FLAGS} github.com/mutablelogic/go-server/plugin/static
3635

37-
npm: $(NPM_DIR)
38-
39-
cmd: dependencies mkdir $(CMD_DIR)
40-
41-
$(NPM_DIR): FORCE
42-
@echo Build npm $(notdir $@)
43-
@cd $@ && ${NPM} run build
36+
cmd: dependencies $(CMD_DIR)
4437

4538
$(CMD_DIR): FORCE
4639
@echo Build cmd $(notdir $@)
@@ -70,19 +63,21 @@ test:
7063
@echo Test pkg/sqobj
7164
@${GO} test ./pkg/sqobj
7265

73-
74-
dependencies:
66+
dependencies: sqlite3 mkdir
7567
ifeq (,${GO})
7668
$(error "Missing go binary")
7769
endif
78-
ifeq (,${NPM})
79-
$(error "Missing npm binary")
80-
endif
70+
71+
sqlite3:
72+
@$(MAKE) -C ${SQLITE_DIR}
8173

8274
mkdir:
8375
@install -d ${BUILD_DIR}
8476

8577
clean:
78+
@echo Clean
8679
@rm -fr $(BUILD_DIR)
8780
@${GO} mod tidy
8881
@${GO} clean
82+
@$(MAKE) -C ${SQLITE_DIR} clean
83+

c/Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
CFLAGS += -std=c99
2+
CFLAGS += -DSQLITE_THREADSAFE=2
3+
CFLAGS += -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1
4+
CFLAGS += -DSQLITE_ENABLE_UNLOCK_NOTIFY
5+
CFLAGS += -DSQLITE_ENABLE_FTS3
6+
CFLAGS += -DSQLITE_ENABLE_FTS5
7+
CFLAGS += -DSQLITE_ENABLE_RTREE
8+
CFLAGS += -DSQLITE_ENABLE_DBSTAT_VTAB
9+
CFLAGS += -DSQLITE_LIKE_DOESNT_MATCH_BLOBS
10+
CFLAGS += -DSQLITE_OMIT_DEPRECATED
11+
CFLAGS += -DSQLITE_ENABLE_JSON1
12+
CFLAGS += -DSQLITE_ENABLE_SESSION
13+
CFLAGS += -DSQLITE_ENABLE_SNAPSHOT
14+
CFLAGS += -DSQLITE_ENABLE_PREUPDATE_HOOK
15+
CFLAGS += -DSQLITE_USE_ALLOCA
16+
CFLAGS += -DSQLITE_ENABLE_COLUMN_METADATA
17+
CFLAGS += -DHAVE_USLEEP=1
18+
CFLAGS += -DSQLITE_DQS=0
19+
CFLAGS += -DSQLITE_ENABLE_GEOPOLY
20+
LDFLAGS = -ldl -lm
21+
22+
all: libsqlite3.a
23+
24+
libsqlite3.a: sqlite3.o
25+
@ar rcs $@ $^
26+
27+
sqlite3.o: sqlite3.c sqlite3.h sqlite3ext.h
28+
@echo Make libsqlite3.a
29+
@$(CC) $(CFLAGS) -c sqlite3.c
30+
31+
clean:
32+
@rm -f sqlite3.o libsqlite3.a

0 commit comments

Comments
 (0)