1
Fork 0
hare-playground/Makefile

49 lines
1,005 B
Makefile
Raw Normal View History

2024-05-28 10:23:52 +00:00
.POSIX:
.SUFFIXES:
HARE=hare
2024-06-01 14:32:31 +00:00
HAREFLAGS ?= -lpthread
2024-05-28 10:23:52 +00:00
DESTDIR=
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
CC ?= cc
CFLAGS = -O2 -Wall -fPIC
classpathify = $(subst $(eval ) ,:,$1)
HAREEXTRAPATH = $(HAREPATH)
HAREEXTRAPATH += $(wildcard vendor/*)
all: proctest httpd threads
proctest: $(wildcard cmd/proctest/*.ha) $(SOURCES)
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
httpd: $(wildcard cmd/httpd/*.ha) $(SOURCES)
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
threads: $(wildcard cmd/threads/*.ha) $(SOURCES)
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
check:
HAREPATH=$(HAREPATH):$(HAREEXTRAPATH) \
$(HARE) test $(HAREFLAGS)
clean:
rm -f proctest httpd threads
install: httpd
install -Dm755 web $(DESTDIR)$(BINDIR)/httpd
uninstall:
rm -f $(DESTDIR)$(BINDIR)/httpd
2024-06-01 17:17:14 +00:00
test: httpd
hurl --test test/api.hurl
.PHONY: all check clean install uninstall test