X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=Makefile;h=fda843827641c7c6103d4978b83098cf0779a296;hb=b2292e770ef96c8abe8cc7134e8defb0b49e902f;hp=a184c76c64e689adaa4706457a32faea26ed3e02;hpb=17619e8c335543dad631060f84f3aa94808e3d2c;p=i3%2Fi3status diff --git a/Makefile b/Makefile index a184c76..fda8438 100644 --- a/Makefile +++ b/Makefile @@ -3,22 +3,38 @@ CFLAGS+=-g CFLAGS+=-std=gnu99 CFLAGS+=-pedantic CFLAGS+=-DPREFIX=\"\" +CFLAGS+=-I. VERSION=$(shell git describe --tags --abbrev=0) ifeq ($(shell uname),Linux) CFLAGS+=-DLINUX CFLAGS+=-D_GNU_SOURCE +LDFLAGS+=-liw +endif + +ifeq ($(shell uname),GNU/kFreeBSD) +CFLAGS+=-lbsd endif # Define this if you want i3status to spit out dzen2-compatible output on stdout #CFLAGS+=-DDZEN CFLAGS+=$(EXTRA_CFLAGS) -i3status: i3status.o i3status.h +src/%.o: src/%.c + @$(CC) $(CFLAGS) -c -o $@ $< + @echo " CC $<" + +%.o: %.c %.h + @$(CC) $(CFLAGS) -c -o $@ $< + @echo " CC $<" + +i3status: src/general.o src/config.o src/get_load.o src/output.o src/get_cpu_temperature.o src/process_runs.o src/get_eth_info.o src/get_ip_addr.o src/get_wireless_info.o src/get_battery_info.o src/get_ipv6_addr.o i3status.o + @$(CC) $(LDFLAGS) -o $@ src/*.o *.o + @echo " LD $@" clean: - rm -f *.o + rm -f *.o src/*.o distclean: clean rm -f i3status @@ -34,7 +50,7 @@ install: release: [ -f i3status-${VERSION} ] || rm -rf i3status-${VERSION} mkdir i3status-${VERSION} - cp *.c *.h *.1 *.conf Makefile i3status-${VERSION} + find . -maxdepth 1 -type f \( -regex ".*\.\(c\|conf\|1\|h\)" -or -name "Makefile" \) -exec cp '{}' i3status-${VERSION} \; tar cjf i3status-${VERSION}.tar.bz2 i3status-${VERSION} rm -rf i3status-${VERSION}