2022-03-20 03:50:43 -04:00
|
|
|
files = pebblisp.c tokens.c object.c env.c web.c plfunc.c
|
2022-03-15 16:49:12 -04:00
|
|
|
libs = -lreadline -lmicrohttpd
|
2020-11-07 00:05:52 -05:00
|
|
|
exe = pl
|
|
|
|
|
2022-03-15 16:49:12 -04:00
|
|
|
file_libs := $(files) $(libs)
|
|
|
|
|
2021-07-05 00:26:18 -04:00
|
|
|
BINPREFIX ?= /usr/bin
|
2020-11-07 00:05:52 -05:00
|
|
|
SCRIPTDIR ?= /usr/local/share/pebblisp
|
2022-03-14 16:51:45 -04:00
|
|
|
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
|
|
mkfile_dir := $(dir $(mkfile_path))
|
2020-11-07 00:05:52 -05:00
|
|
|
|
2022-03-30 16:47:43 -04:00
|
|
|
GCC_ARGS ?= -g -Wall -o $(exe) -D WEBSERVER -D STANDALONE -DSCRIPTDIR=\"$(SCRIPTDIR)\"
|
|
|
|
GCC_COM ?= gcc -O0 $(GCC_ARGS)
|
2020-05-15 16:27:45 -04:00
|
|
|
|
2022-03-31 11:41:02 -04:00
|
|
|
all: notest
|
|
|
|
echo && ./tests.sh
|
2022-03-30 16:47:43 -04:00
|
|
|
|
2020-05-15 16:27:45 -04:00
|
|
|
notest:
|
2022-03-15 16:49:12 -04:00
|
|
|
$(GCC_COM) $(file_libs)
|
2020-05-06 00:47:14 -04:00
|
|
|
|
2022-03-31 11:41:02 -04:00
|
|
|
val: notest
|
|
|
|
./tests.sh -val
|
2022-03-31 10:29:06 -04:00
|
|
|
|
2022-03-31 11:41:02 -04:00
|
|
|
release_notest:
|
|
|
|
gcc -O3 $(GCC_ARGS) $(file_libs) && strip ./$(exe)
|
2022-03-14 16:51:45 -04:00
|
|
|
|
2022-03-31 11:41:02 -04:00
|
|
|
release: release_notest
|
|
|
|
echo && ./tests.sh
|
2020-05-14 23:50:53 -04:00
|
|
|
|
2020-05-06 00:47:14 -04:00
|
|
|
debug:
|
2022-03-15 16:49:12 -04:00
|
|
|
$(GCC_COM) -D DEBUG $(file_libs)
|
2020-05-07 20:32:01 -04:00
|
|
|
|
2020-05-08 02:29:06 -04:00
|
|
|
run:
|
2020-05-19 20:37:15 -04:00
|
|
|
./$(exe)
|
2020-10-29 09:04:32 -04:00
|
|
|
|
|
|
|
install:
|
2020-11-07 00:05:52 -05:00
|
|
|
cp -pf ./$(exe) $(BINPREFIX)
|
|
|
|
mkdir -p $(SCRIPTDIR)
|
2022-03-28 09:56:24 -04:00
|
|
|
cp -r ./examples/* $(SCRIPTDIR)
|
2020-11-07 00:05:52 -05:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm $(BINPREFIX)/$(exe)
|
|
|
|
rm -r $(SCRIPTDIR)
|