41 lines
685 B
Makefile
41 lines
685 B
Makefile
.POSIX:
|
|
.SUFFIXES:
|
|
HARE=hare
|
|
HAREFLAGS ?= -lpthread
|
|
|
|
DESTDIR=
|
|
PREFIX=/usr/local
|
|
BINDIR=$(PREFIX)/bin
|
|
|
|
CC ?= cc
|
|
CFLAGS = -O2 -Wall -fPIC
|
|
|
|
classpathify = $(subst $(eval ) ,:,$1)
|
|
|
|
HAREEXTRAPATH = $(HAREPATH)
|
|
HAREEXTRAPATH += $(wildcard vendor/*)
|
|
|
|
all: httpd
|
|
|
|
httpd: $(wildcard cmd/httpd/*.ha) $(SOURCES)
|
|
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
|
|
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
|
|
|
|
check:
|
|
HAREPATH=$(HAREPATH):$(HAREEXTRAPATH) \
|
|
$(HARE) test $(HAREFLAGS)
|
|
|
|
clean:
|
|
rm -f httpd
|
|
|
|
install: httpd
|
|
install -Dm755 web $(DESTDIR)$(BINDIR)/httpd
|
|
|
|
uninstall:
|
|
rm -f $(DESTDIR)$(BINDIR)/httpd
|
|
|
|
test: httpd
|
|
hurl --test test/api.hurl
|
|
|
|
.PHONY: all check clean install uninstall test
|