1
Fork 0
hare-playground/backend/Makefile

46 lines
948 B
Makefile
Raw Normal View History

2024-05-28 10:23:52 +00:00
.POSIX:
.SUFFIXES:
HARE=hare
HAREFLAGS=
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