Makefile (532B) - raw


      1 PREFIX ?= /usr/local
      2 CC ?= cc
      3 LDFLAGS = -lX11
      4 
      5 binsrc = $(wildcard bin/*)
      6 binobj = $(patsubst %,$(DESTDIR)$(PREFIX)/%,$(binsrc))
      7 
      8 dwmblocks: dwmblocks.c config.h
      9 	${CC} dwmblocks.c $(LDFLAGS) -o dwmblocks
     10 
     11 config.h:
     12 	cp config.def.h $@
     13 
     14 install: dwmblocks $(binobj)
     15 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     16 	install -m 0755 dwmblocks $(DESTDIR)$(PREFIX)/bin/dwmblocks
     17 
     18 $(DESTDIR)$(PREFIX)/%: %
     19 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     20 	install -m 0755 $< $@
     21 
     22 uninstall:
     23 	rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks
     24 
     25 clean:
     26 	rm -f *.o *.gch dwmblocks