1
Fork 0
hare-playground/Makefile
2024-06-01 16:46:01 +02:00

46 lines
960 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: 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
.PHONY: all check clean install uninstall