usqlite/Makefile

57 lines
888 B
Makefile
Raw Normal View History

2020-08-14 23:10:03 +00:00
MAKE=gmake
DEFS=
SRCS= usqlite.c
HDRS=
OBJS= $(SRCS:.c=.o)
CC=gcc
#CC=mipsel-linux-gcc
DEFS=-D_XOPEN_SOURCE=500 -DTGT_SQLITE_VERSION_NUMBER=3007002
CFLAGS=-g -std=c99
INCS=
LIBS=
#CFLAGS=-g -O3 -fno-strict-aliasing
#WARN=-pedantic -Wall -Wnested-externs -Wpointer-arith -Werror -Wno-unused
WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long
PLATFORM=$(shell uname -s | cut -d- -f1)
ifeq ($(PLATFORM),Linux)
LIBS=-lsqlite3
endif
all: usqlite
install: usqlite
strip $<
cp $< /mod/bin/
usqlite: ${OBJS}
@echo "Linking..."
@-[ -f $@ ] && mv $@ $@~ || exit 0
${CC} -static-libgcc \
${WARN} \
${DEFS} \
${CFLAGS} -o $@ \
${OBJS} \
${LIBS}
@echo "Done..."
clean:
@-touch core
rm -f usqlite usqlite~ core ${OBJS}
#tags:
# @-ctags *.[ch] 2>> /dev/null
.c.o:
@echo " $<"
@$(CC) $(CFLAGS) ${WARN} ${DEFS} ${INCS} -c $< -o $@
${OBJS}: ${HDRS}