~smlavine/ascii-breakout

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Improve Makefile

Details
Message ID
<20220103154736.18203-1-yyp@disroot.org>
DKIM signature
pass
Download raw message
Patch: +24 -2
---
Not sure if you want this

 Makefile | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 3369416..36883dc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,24 @@
ascii-breakout: ./*.c ./*.h
	cc -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Wextra -Wpedantic -Werror=implicit-function-declaration ./*.c -o ascii-breakout
CC = cc
CFLAGS = -std=c99 -D_POSIX_C_SOURCE=200809L
WARN = -Wall -Wextra -Wpedantic -Werror=implicit-function-declaration

PREFIX = /usr/local

SRC = main.c

all: ascii-breakout

ascii-breakout: $(SRC) rogueutil.h
	$(CC) $(CFLAGS) $(WARN) -o $@ $(SRC)

clean:
	rm -f ascii-breakout

install:
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	cp ascii-breakout $(DESTDIR)$(PREFIX)/bin

uninstall:
	rm $(DESTDIR)$(PREFIX)/bin/ascii-breakout

.PHONY: all clean install uninstall
-- 
2.34.1
Details
Message ID
<CGW5XH8EFQ6W.2GLAC0UEXC0YJ@archlinux-x220>
In-Reply-To
<20220103154736.18203-1-yyp@disroot.org> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thank you, this is a massive improvement. I might play with this further
to add a config.mk, but still a lot more useful and configurable than
what I had before.

Applied, with one minor adjustment:

> ...
> + rm -f ascii-breakout
> +
> +install:
> + mkdir -p $(DESTDIR)$(PREFIX)/bin
> + cp ascii-breakout $(DESTDIR)$(PREFIX)/bin
> ...

was changed to 

> ...
> + rm -f ascii-breakout
> +
> +install: all
> + mkdir -p $(DESTDIR)$(PREFIX)/bin
> + cp ascii-breakout $(DESTDIR)$(PREFIX)/bin
> ...

so that ```make install``` works even when the ```ascii-breakout```
binary doesn't already exist.

To git.sr.ht:~smlavine/ascii-breakout
   fb59ff7..60944e7  master -> master
Reply to thread Export thread (mbox)