aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2021-07-02 03:48:06 +0000
committerclsr <clsr@clsr.net>2021-07-02 03:48:06 +0000
commit41deab98a5c0ac7162cd2fe21a786e022cc53670 (patch)
treec495121579c79c61e06d25ba4a2ed1b9b7fa82f0 /Makefile
parent50e382e5efe6bdad568a507e7ec675e27e94d428 (diff)
downloaddwmclock-41deab98a5c0ac7162cd2fe21a786e022cc53670.tar.gz
dwmclock-41deab98a5c0ac7162cd2fe21a786e022cc53670.zip
Add dwmclock-printv1.4.0
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 14 insertions, 5 deletions
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