quark

quark web server
git clone git://git.suckless.org/quark
Log | Files | Refs | LICENSE

Makefile (1249B)


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