slstatus

status monitor
git clone git://git.suckless.org/slstatus
Log | Files | Refs | README | LICENSE

Makefile (1773B)


      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/kernel_release\
     18 	components/keyboard_indicators\
     19 	components/keymap\
     20 	components/load_avg\
     21 	components/netspeeds\
     22 	components/num_files\
     23 	components/ram\
     24 	components/run_command\
     25 	components/swap\
     26 	components/temperature\
     27 	components/uptime\
     28 	components/user\
     29 	components/volume\
     30 	components/wifi
     31 
     32 all: slstatus
     33 
     34 $(COM:=.o): config.mk $(REQ:=.h) slstatus.h
     35 slstatus.o: slstatus.c slstatus.h arg.h config.h config.mk $(REQ:=.h)
     36 
     37 .c.o:
     38 	$(CC) -o $@ -c $(CPPFLAGS) $(CFLAGS) $<
     39 
     40 config.h:
     41 	cp config.def.h $@
     42 
     43 slstatus: slstatus.o $(COM:=.o) $(REQ:=.o)
     44 	$(CC) -o $@ $(LDFLAGS) $(COM:=.o) $(REQ:=.o) slstatus.o $(LDLIBS)
     45 
     46 clean:
     47 	rm -f slstatus slstatus.o $(COM:=.o) $(REQ:=.o) slstatus-${VERSION}.tar.gz
     48 
     49 dist:
     50 	rm -rf "slstatus-$(VERSION)"
     51 	mkdir -p "slstatus-$(VERSION)/components"
     52 	cp -R LICENSE Makefile README config.mk config.def.h \
     53 	      arg.h slstatus.h slstatus.c $(REQ:=.c) $(REQ:=.h) \
     54 	      slstatus.1 "slstatus-$(VERSION)"
     55 	cp -R $(COM:=.c) "slstatus-$(VERSION)/components"
     56 	tar -cf - "slstatus-$(VERSION)" | gzip -c > "slstatus-$(VERSION).tar.gz"
     57 	rm -rf "slstatus-$(VERSION)"
     58 
     59 install: all
     60 	mkdir -p "$(DESTDIR)$(PREFIX)/bin"
     61 	cp -f slstatus "$(DESTDIR)$(PREFIX)/bin"
     62 	chmod 755 "$(DESTDIR)$(PREFIX)/bin/slstatus"
     63 	mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
     64 	cp -f slstatus.1 "$(DESTDIR)$(MANPREFIX)/man1"
     65 	chmod 644 "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"
     66 
     67 uninstall:
     68 	rm -f "$(DESTDIR)$(PREFIX)/bin/slstatus"
     69 	rm -f "$(DESTDIR)$(MANPREFIX)/man1/slstatus.1"