spoon

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

Makefile (1683B)


      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 # if ALSA
     24 LDLIBS_Linux_mix = -lasound
     25 CPPFLAGS += -DUSE_TINYALSA=0
     26 # else TinyALSA
     27 #LDLIBS_Linux_mix = -ltinyalsa
     28 #CPPFLAGS += -DUSE_TINYALSA=1
     29 LDLIBS += $(LDLIBS_$(UNAME)_mix)
     30 
     31 OBJ += xkblayout.o
     32 LDLIBS += -lxkbfile
     33 
     34 OBJ += mpd.o
     35 LDLIBS += -lmpdclient
     36 
     37 all: $(BIN)
     38 
     39 spoon.o: config.h
     40 
     41 config.h:
     42 	cp config.def.h $@
     43 
     44 clean:
     45 	rm -f $(OBJ) $(BIN) $(BIN)-$(VERSION).tar.gz
     46 
     47 install: all
     48 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     49 	cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
     50 
     51 uninstall:
     52 	rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
     53 
     54 dist:
     55 	mkdir -p $(BIN)-$(VERSION)
     56 	cp $(DISTFILES) $(BIN)-$(VERSION)
     57 	tar -cf $(BIN)-$(VERSION).tar $(BIN)-$(VERSION)
     58 	gzip $(BIN)-$(VERSION).tar
     59 	rm -rf $(BIN)-$(VERSION)
     60 
     61 .PHONY: all clean install uninstall dist
     62 
     63 .SUFFIXES: .c .o
     64 
     65 .c.o:
     66 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
     67 
     68 $(BIN): $(OBJ)
     69 	$(CC) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)