VERSION = 0.2 CC := gcc CFLAGS += -W -Wall -g -Os \ `pkg-config --cflags glib-2.0` `pkg-config --cflags libpng` \ -D VERSION=\"$(VERSION)\" -fstack-protector -D_FORTIFY_SOURCE=2 \ -Wformat -fno-common -Wimplicit-function-declaration -Wimplicit-int PROG = mkdevnodes OBJS := $(PROG).o all: $(PROG) %.o: %.c Makefile @echo " CC $<" @$(CC) $(CFLAGS) -c -o $@ $< $(PROG): $(PROG).o @echo " LD $@" @$(CC) $^ -o $@ clean: rm -f *~ *.o $(PROG) install: mkdir -p $(DESTDIR)/sbin install -D -m0755 $(PROG) $(DESTDIR)/sbin/$(PROG) dist: clean git tag v$(VERSION) git archive --format=tar -v --prefix="$(PROG)-$(VERSION)/" \ v$(VERSION) | gzip > $(PROG)-$(VERSION).tar.gz