slstatus

mrgrouse's slstatus fork for the dwm window manager
Log | Files | Refs | README | LICENSE

Makefile (1801B)


      1 # See LICENSE file for copyright and license details
      2 # slstatus - suckless status monitor
      3 .POSIX:
      4 
      5 include config.mk
      6 
      7 REQ = util
      8 COM =\
      9 	components/battery\
     10 	components/cat\
     11 	components/cpu\
     12 	components/datetime\
     13 	components/disk\
     14 	components/entropy\
     15 	components/hostname\
     16 	components/ip\
     17 	components/kanji\
     18 	components/kernel_release\
     19 	components/keyboard_indicators\
     20 	components/keymap\
     21 	components/load_avg\
     22 	components/netspeeds\
     23 	components/num_files\
     24 	components/ram\
     25 	components/run_command\
     26 	components/swap\
     27 	components/temperature\
     28 	components/uptime\
     29 	components/user\
     30 	components/volume\
     31 	components/wifi
     32 
     33 all: slstatus
     34 
     35 $(COM:=.o): config.mk $(REQ:=.h) slstatus.h
     36 slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h)
     37 
     38 .c.o:
     39 	$(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $<
     40 
     41 config.h:
     42 	cp config.def.h $@
     43 
     44 slstatus: slstatus.o $(COM:=.o) $(REQ:=.o)
     45 	$(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(REQ:=.o) slstatus.o $(LDLIBS)
     46 
     47 clean:
     48 	rm -f config.h slstatus slstatus.o $(COM:=.o) $(REQ:=.o) slstatus-${VERSION}.tar.gz
     49 
     50 dist:
     51 	rm -rf "slstatus-$(VERSION)"
     52 	mkdir -p "slstatus-$(VERSION)/components"
     53 	cp -R LICENSE Makefile README config.mk config.def.h \
     54 	      arg.h slstatus.h slstatus.c $(REQ:=.c) $(REQ:=.h) \
     55 	      slstatus.1 "slstatus-$(VERSION)"
     56 	cp -R $(COM:=.c) "slstatus-$(VERSION)/components"
     57 	tar -cf - "slstatus-$(VERSION)" | gzip -c > "slstatus-$(VERSION).tar.gz"
     58 	rm -rf "slstatus-$(VERSION)"
     59 
     60 install: all
     61 	mkdir -p "$(DESTDIR)$(PREFIX)/bin"
     62 	cp -f slstatus "$(DESTDIR)$(PREFIX)/bin"
     63 	chmod 755 "$(DESTDIR)$(PREFIX)/bin/slstatus"
     64 	mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
     65 	cp -f slstatus.1 "$(DESTDIR)$(MANPREFIX)/man1"
     66 	chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"
     67 
     68 uninstall:
     69 	rm -f "$(DESTDIR)$(PREFIX)/bin/slstatus"
     70 	rm -f "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"