|
1 | 1 | # Makefile for SQLite Sync Extension |
2 | 2 | # Supports compilation for Linux, macOS, Windows, Android and iOS |
3 | 3 |
|
| 4 | +# customize sqlite3 executable with |
| 5 | +# make test SQLITE3=/opt/homebrew/Cellar/sqlite/3.49.1/bin/sqlite3 |
| 6 | +SQLITE3 ?= sqlite3 |
| 7 | + |
4 | 8 | # Set default platform if not specified |
5 | 9 | ifeq ($(OS),Windows_NT) |
6 | 10 | PLATFORM := windows |
@@ -136,14 +140,89 @@ $(BUILD_TEST)/%.o: %.c |
136 | 140 |
|
137 | 141 | # Run code coverage (--css-file $(CUSTOM_CSS)) |
138 | 142 | test: $(TARGET) $(TEST_TARGET) |
139 | | - sqlite3 ":memory:" -cmd ".bail on" ".load ./$<" "SELECT cloudsync_version();" |
| 143 | + $(SQLITE3) ":memory:" -cmd ".bail on" ".load ./$<" "SELECT cloudsync_version();" |
140 | 144 | ./$(TEST_TARGET) |
141 | 145 | ifneq ($(COVERAGE),false) |
142 | 146 | mkdir -p $(COV_DIR) |
143 | 147 | lcov --capture --directory . --output-file $(COV_DIR)/coverage.info $(subst src, --include src,${COV_FILES}) |
144 | 148 | genhtml $(COV_DIR)/coverage.info --output-directory $(COV_DIR) |
145 | 149 | endif |
146 | 150 |
|
| 151 | +deps: |
| 152 | + brew install autoconf automake libtool pkg-config |
| 153 | + |
| 154 | +curl-src: |
| 155 | + @if [ ! -d curl-src ]; then \ |
| 156 | + git clone --depth 1 --branch curl-8_12_1 https://github.com/curl/curl.git curl-src; \ |
| 157 | + fi |
| 158 | + |
| 159 | +libcurl-macos: deps curl-src |
| 160 | + @if [ ! -f $(CONFIGURED_MARKER) ]; then \ |
| 161 | + cd curl-src && ./buildconf && ./configure \ |
| 162 | + --without-libpsl \ |
| 163 | + --disable-alt-svc \ |
| 164 | + --disable-ares \ |
| 165 | + --disable-cookies \ |
| 166 | + --disable-basic-auth \ |
| 167 | + --disable-digest-auth \ |
| 168 | + --disable-kerberos-auth \ |
| 169 | + --disable-negotiate-auth \ |
| 170 | + --disable-aws \ |
| 171 | + --disable-dateparse \ |
| 172 | + --disable-dnsshuffle \ |
| 173 | + --disable-doh \ |
| 174 | + --disable-form-api \ |
| 175 | + --disable-hsts \ |
| 176 | + --disable-ipv6 \ |
| 177 | + --disable-libcurl-option \ |
| 178 | + --disable-manual \ |
| 179 | + --disable-mime \ |
| 180 | + --disable-netrc \ |
| 181 | + --disable-ntlm \ |
| 182 | + --disable-ntlm-wb \ |
| 183 | + --disable-progress-meter \ |
| 184 | + --disable-proxy \ |
| 185 | + --disable-pthreads \ |
| 186 | + --disable-socketpair \ |
| 187 | + --disable-threaded-resolver \ |
| 188 | + --disable-tls-srp \ |
| 189 | + --disable-verbose \ |
| 190 | + --disable-versioned-symbols \ |
| 191 | + --enable-symbol-hiding \ |
| 192 | + --without-brotli \ |
| 193 | + --without-zstd \ |
| 194 | + --without-libidn2 \ |
| 195 | + --without-librtmp \ |
| 196 | + --without-zlib \ |
| 197 | + --without-nghttp2 \ |
| 198 | + --without-ngtcp2 \ |
| 199 | + --disable-shared \ |
| 200 | + --disable-ftp \ |
| 201 | + --disable-file \ |
| 202 | + --disable-ipfs \ |
| 203 | + --disable-ldap \ |
| 204 | + --disable-ldaps \ |
| 205 | + --disable-rtsp \ |
| 206 | + --disable-dict \ |
| 207 | + --disable-telnet \ |
| 208 | + --disable-tftp \ |
| 209 | + --disable-pop3 \ |
| 210 | + --disable-imap \ |
| 211 | + --disable-smb \ |
| 212 | + --disable-smtp \ |
| 213 | + --disable-gopher \ |
| 214 | + --disable-mqtt \ |
| 215 | + --disable-docs \ |
| 216 | + --enable-static \ |
| 217 | + --with-secure-transport \ |
| 218 | + CFLAGS="-arch x86_64 -arch arm64" \ |
| 219 | + else \ |
| 220 | + echo "Skipping configure: already configured."; \ |
| 221 | + fi |
| 222 | + cd curl-src && make |
| 223 | + mkdir -p curl/macos |
| 224 | + mv curl-src/lib/.libs/libcurl.a curl/macos |
| 225 | + |
147 | 226 | # Clean up generated files |
148 | 227 | clean: |
149 | 228 | rm -rf $(BUILD_DIRS) $(DIST_DIR)/* $(COV_DIR) *.gcda *.gcno *.gcov |
|
0 commit comments