1
0
mirror of https://github.com/janet-lang/janet synced 2024-09-16 01:09:37 +00:00
janet/natives/sqlite3/Makefile

58 lines
1.8 KiB
Makefile
Raw Normal View History

2018-05-09 22:14:30 +00:00
# Copyright (c) 2018 Calvin Rose
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
2018-06-23 23:19:26 +00:00
CFLAGS=-std=c99 -Wall -Wextra -I../../src/include -O2 -shared -fpic \
-DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION
2018-05-20 01:29:22 +00:00
TARGET=sqlite3.so
2018-05-09 22:14:30 +00:00
2018-05-23 00:45:52 +00:00
# MacOS specifics
UNAME:=$(shell uname -s)
ifeq ($(UNAME), Darwin)
CFLAGS:=$(CFLAGS) -undefined dynamic_lookup
endif
2018-06-23 23:19:26 +00:00
# Default target
all: $(TARGET)
OBJECTS:=main.o sqlite3.o
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^
2018-05-09 22:14:30 +00:00
sqlite-autoconf-3230100/sqlite3.%:
curl https://www.sqlite.org/2018/sqlite-autoconf-3230100.tar.gz | tar -xvz
2018-06-23 23:19:26 +00:00
sqlite3.c: sqlite-autoconf-3230100/sqlite3.c
cp $< $@
sqlite3.h: sqlite-autoconf-3230100/sqlite3.h
2018-05-09 22:14:30 +00:00
cp $< $@
2018-06-23 23:19:26 +00:00
%.o: %.c
$(CC) $(CFLAGS) -c $<
2018-05-09 22:14:30 +00:00
clean:
rm -rf sqlite-autoconf-3230100
2018-06-23 23:19:26 +00:00
rm *.o
2018-05-09 22:14:30 +00:00
rm sqlite3.c
rm sqlite3.h
rm $(TARGET)
2018-06-23 23:19:26 +00:00
.PHONY: clean all