CFLAGS ?= -Wall -O2 -g -Wstrict-prototypes -Wmissing-prototypes LDFLAGS ?= -L/usr/lib -Wl,-z,defs LIBRARIES = -lX11 XTOOL=xtoolwait all: $(XTOOL) $(XTOOL): $(XTOOL).o gcc $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBRARIES) %.o: %.c gcc $(CFLAGS) -c -o $@ $< clean: -rm $(XTOOL) *.o install: $(XTOOL) mkdir -p $(prefix)/bin $(prefix)/share/man/man1 install -s $(XTOOL) $(prefix)/bin/ install $(XTOOL).man $(prefix)/share/man/man1/$(XTOOL).1 && gzip $(prefix)/share/man/man1/$(XTOOL).1