spoon

set dwm status
git clone git://git.2f30.org/spoon
Log | Files | Refs | LICENSE

Makefile (1712B)


      1 VERSION = 0.6
      2 PREFIX = /usr/local
      3 SRC = spoon.c batt.c wifi.c cpu.c count.c temp.c date.c load.c file.c key.c\
      4       netspeed.c strlcpy.c strlcat.c stub.c mix.c xkblayout.c mpd.c brightness.c
      5 OBJ = spoon.o batt.o wifi.o cpu.o count.o temp.o date.o load.o file.o key.o\
      6       netspeed.o strlcpy.o strlcat.o stub.o brightness.o
      7 BIN = spoon
      8 DISTFILES = $(SRC) arg.h types.h util.h config.def.h Makefile LICENSE configure
      9 
     10 include config.mk
     11 
     12 CPPFLAGS_OpenBSD = -I/usr/X11R6/include -I/usr/local/include
     13 LDFLAGS_OpenBSD = -L/usr/X11R6/lib -L/usr/local/lib
     14 CPPFLAGS_Linux = -I/usr/local/include
     15 CPPFLAGS = $(CPPFLAGS_$(UNAME))
     16 LDFLAGS = $(LDFLAGS_$(UNAME))
     17 LDLIBS = -lX11
     18 
     19 # To remove extra compile time dependencies for unwanted plugins
     20 # comment out the following sections.  The stub implementations
     21 # from stub.c will be used instead.
     22 OBJ += mix.o
     23 LDLIBS_OpenBSD_mix = -lsndio
     24 # if ALSA
     25 LDLIBS_Linux_mix = -lasound
     26 CPPFLAGS += -DUSE_TINYALSA=0
     27 # else TinyALSA
     28 #LDLIBS_Linux_mix = -ltinyalsa
     29 #CPPFLAGS += -DUSE_TINYALSA=1
     30 LDLIBS += $(LDLIBS_$(UNAME)_mix)
     31 
     32 OBJ += xkblayout.o
     33 LDLIBS += -lxkbfile
     34 
     35 OBJ += mpd.o
     36 LDLIBS += -lmpdclient
     37 
     38 all: $(BIN)
     39 
     40 spoon.o: config.h
     41 
     42 config.h:
     43 	cp config.def.h $@
     44 
     45 clean:
     46 	rm -f $(OBJ) $(BIN) $(BIN)-$(VERSION).tar.gz
     47 
     48 install: all
     49 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     50 	cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
     51 
     52 uninstall:
     53 	rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
     54 
     55 dist:
     56 	mkdir -p $(BIN)-$(VERSION)
     57 	cp $(DISTFILES) $(BIN)-$(VERSION)
     58 	tar -cf $(BIN)-$(VERSION).tar $(BIN)-$(VERSION)
     59 	gzip $(BIN)-$(VERSION).tar
     60 	rm -rf $(BIN)-$(VERSION)
     61 
     62 .PHONY: all clean install uninstall dist
     63 
     64 .SUFFIXES: .c .o
     65 
     66 .c.o:
     67 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
     68 
     69 $(BIN): $(OBJ)
     70 	$(CC) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)