2017-06-20 19:40:00 +00:00
|
|
|
# See LICENSE file for copyright and license details
|
2016-09-02 07:59:02 +00:00
|
|
|
# quark - simple web server
|
2017-06-20 19:40:00 +00:00
|
|
|
.POSIX:
|
2016-09-02 07:59:02 +00:00
|
|
|
|
|
|
|
include config.mk
|
|
|
|
|
2020-08-30 12:16:41 +00:00
|
|
|
COMPONENTS = data http sock util dirl
|
2018-02-04 20:27:33 +00:00
|
|
|
|
2016-09-02 08:43:27 +00:00
|
|
|
all: quark
|
2016-09-02 07:59:02 +00:00
|
|
|
|
2020-08-30 12:16:41 +00:00
|
|
|
data.o: data.c data.h util.h http.h dirl.h config.mk
|
2020-08-25 19:08:23 +00:00
|
|
|
dirl.o: dirl.c dirl.h util.h http.h config.mk
|
2020-08-28 21:29:54 +00:00
|
|
|
http.o: http.c http.h util.h http.h data.h config.h config.mk
|
2018-02-04 20:27:33 +00:00
|
|
|
main.o: main.c util.h sock.h http.h arg.h config.h config.mk
|
2020-08-28 21:29:54 +00:00
|
|
|
sock.o: sock.c sock.h util.h config.mk
|
|
|
|
util.o: util.c util.h config.mk
|
2018-02-04 20:27:33 +00:00
|
|
|
|
|
|
|
quark: $(COMPONENTS:=.o) $(COMPONENTS:=.h) main.o config.mk
|
|
|
|
$(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $(COMPONENTS:=.o) main.o $(LDFLAGS)
|
2016-09-02 07:59:02 +00:00
|
|
|
|
|
|
|
config.h:
|
2016-09-02 08:49:42 +00:00
|
|
|
cp config.def.h $@
|
2016-09-02 07:59:02 +00:00
|
|
|
|
|
|
|
clean:
|
2018-02-04 20:27:33 +00:00
|
|
|
rm -f quark main.o $(COMPONENTS:=.o)
|
2016-09-02 07:59:02 +00:00
|
|
|
|
2017-06-20 19:40:00 +00:00
|
|
|
dist:
|
|
|
|
rm -rf "quark-$(VERSION)"
|
|
|
|
mkdir -p "quark-$(VERSION)"
|
2016-09-02 08:49:42 +00:00
|
|
|
cp -R LICENSE Makefile arg.h config.def.h config.mk quark.1 \
|
2018-02-04 20:27:33 +00:00
|
|
|
$(COMPONENTS:=.c) $(COMPONENTS:=.h) main.c "quark-$(VERSION)"
|
2017-06-20 19:40:00 +00:00
|
|
|
tar -cf - "quark-$(VERSION)" | gzip -c > "quark-$(VERSION).tar.gz"
|
|
|
|
rm -rf "quark-$(VERSION)"
|
2016-09-02 07:59:02 +00:00
|
|
|
|
|
|
|
install: all
|
2017-06-20 19:40:00 +00:00
|
|
|
mkdir -p "$(DESTDIR)$(PREFIX)/bin"
|
|
|
|
cp -f quark "$(DESTDIR)$(PREFIX)/bin"
|
|
|
|
chmod 755 "$(DESTDIR)$(PREFIX)/bin/quark"
|
|
|
|
mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
|
|
|
|
cp quark.1 "$(DESTDIR)$(MANPREFIX)/man1/quark.1"
|
|
|
|
chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/quark.1"
|
2016-09-02 07:59:02 +00:00
|
|
|
|
|
|
|
uninstall:
|
2017-06-20 19:40:00 +00:00
|
|
|
rm -f "$(DESTDIR)$(PREFIX)/bin/quark"
|
|
|
|
rm -f "$(DESTDIR)$(MANPREFIX)/man1/quark.1"
|