Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.5 KiB

  1. # See LICENSE file for copyright and license details
  2. # quark - simple web server
  3. .POSIX:
  4. include config.mk
  5. COMPONENTS = connection data http queue server sock util
  6. all: quark
  7. connection.o: connection.c config.h connection.h data.h http.h server.h sock.h util.h config.mk
  8. data.o: data.c config.h data.h http.h server.h util.h config.mk
  9. http.o: http.c config.h http.h server.h util.h config.mk
  10. main.o: main.c arg.h config.h server.h sock.h util.h config.mk
  11. server.o: server.c config.h connection.h http.h queue.h server.h util.h config.mk
  12. sock.o: sock.c config.h sock.h util.h config.mk
  13. util.o: util.c config.h util.h config.mk
  14. quark: config.h $(COMPONENTS:=.o) $(COMPONENTS:=.h) main.o config.mk
  15. $(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $(COMPONENTS:=.o) main.o $(LDFLAGS)
  16. config.h:
  17. cp config.def.h $@
  18. clean:
  19. rm -f quark main.o $(COMPONENTS:=.o)
  20. dist:
  21. rm -rf "quark-$(VERSION)"
  22. mkdir -p "quark-$(VERSION)"
  23. cp -R LICENSE Makefile arg.h config.def.h config.mk quark.1 \
  24. $(COMPONENTS:=.c) $(COMPONENTS:=.h) main.c "quark-$(VERSION)"
  25. tar -cf - "quark-$(VERSION)" | gzip -c > "quark-$(VERSION).tar.gz"
  26. rm -rf "quark-$(VERSION)"
  27. install: all
  28. mkdir -p "$(DESTDIR)$(PREFIX)/bin"
  29. cp -f quark "$(DESTDIR)$(PREFIX)/bin"
  30. chmod 755 "$(DESTDIR)$(PREFIX)/bin/quark"
  31. mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
  32. cp quark.1 "$(DESTDIR)$(MANPREFIX)/man1/quark.1"
  33. chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/quark.1"
  34. uninstall:
  35. rm -f "$(DESTDIR)$(PREFIX)/bin/quark"
  36. rm -f "$(DESTDIR)$(MANPREFIX)/man1/quark.1"