From 41deab98a5c0ac7162cd2fe21a786e022cc53670 Mon Sep 17 00:00:00 2001 From: clsr Date: Fri, 2 Jul 2021 03:48:06 +0000 Subject: Add dwmclock-print --- Makefile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 5133980..518f30c 100644 --- a/Makefile +++ b/Makefile @@ -20,17 +20,26 @@ all: $(SRC) $(MAIN) $(MAIN): $(OBJ) $(CC) $(LDFLAGS) -o $@ $(OBJ) +$(MAIN)-print: CFLAGS+=-DPRINT +$(MAIN)-print: LDFLAGS= +$(MAIN)-print: $(OBJ:.o=-print.o) + $(CC) $(LDFLAGS) -o $@ $(OBJ:.o=-print.o) + +%-print.o: + $(CC) -c $(CFLAGS) $(@:-print.o=.c) -o $@ + .c.o: - $(CC) -c $(CFLAGS) $< -o $@ -O2 + $(CC) -c $(CFLAGS) $< -o $@ clean: - -rm -f $(MAIN) $(OBJ) + -rm -f $(MAIN) $(OBJ) $(MAIN)-print $(OBJ:.o=-print.o) install: $(MAIN) - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp $(MAIN) $(DESTDIR)$(PREFIX)/bin/$(MAIN) + install -d $(DESTDIR)$(PREFIX)/bin/ + install -m 755 $(MAIN) $(DESTDIR)$(PREFIX)/bin/ + [ -f $(MAIN)-print ] && install -m 755 $(MAIN)-print $(DESTDIR)$(PREFIX)/bin/ uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/$(MAIN) + rm -f $(DESTDIR)$(PREFIX)/bin/$(MAIN) $(DESTDIR)$(PREFIX)/bin/$(MAIN)-print .PHONY: all clean install uninstall -- cgit