diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-07-18 07:21:15 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-07-18 07:21:15 +0000 |
| commit | 0783f3a56842e72c3a8f1079e6e522fdb66939f1 (patch) | |
| tree | 549ca0432e819e904181724bd752a7cc56829291 /Makefile | |
| parent | 71b2cbcf9d1eb730fec8aa64436d7ea59d7cec08 (diff) | |
fcc 'chroe posix makefile'
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 46 |
1 files changed, 23 insertions, 23 deletions
@@ -14,9 +14,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -.PHONY: default debug install defconfig clean +.PHONY: default debug install defconfig rmconfig clean uninstall -CC ?= clang +CC ?= cc RM = rm -f PREFIX ?= /usr/local OBJDIR = obj @@ -27,24 +27,24 @@ CFLAGS += $(shell pkg-config --cflags luajit) -I./include -Wno-format-truncatio # pretty print for compilation. To enable verbose (show commands), run with # `make V=1` ifeq ($(strip $(V)),) - E = @echo + E = echo Q = @ else - E = @\# + E = : Q = endif default: pkgit pkgit: $(OBJS) - $(E) " LINK " $@ - $(Q) ${CC} -o $@ $^ $(shell pkg-config --libs luajit) $(shell pkg-config --libs libgit2) $(LDFLAGS) -g + $(Q) echo " LINK " $@ + $(Q) ${CC} -o $@ $^ $(shell pkg-config --libs luajit) $(LDFLAGS) -g $(OBJDIR): @mkdir -p $(OBJDIR) $(OBJDIR)/%.o: src/%.c | $(OBJDIR) - $(E) " CC " $@ + $(Q) echo " CC " $@ $(Q) ${CC} $(CFLAGS) -c -o $@ $< gdb: CFLAGS += -g -O0 -Wall -Wextra -Werror -Wvla -pedantic @@ -55,30 +55,30 @@ debug: LDFLAGS += -fsanitize=address debug: pkgit install: pkgit - $(E) " INSTALL" ${DESTDIR}${PREFIX} + $(Q) echo " INSTALL " ${DESTDIR}${PREFIX} $(Q) install -d ${DESTDIR}${PREFIX}/bin $(Q) install -m 755 pkgit ${DESTDIR}${PREFIX}/bin/pkgit $(Q) install -d ${DESTDIR}${PREFIX}/share/man/man1 $(Q) install -m 644 docs/pkgit.1 ${DESTDIR}${PREFIX}/share/man/man1/pkgit.1 -uninstall: ${DESTDIR}${PREFIX}/bin/pkgit - $(E) " UNINSTALL" ${DESTDIR}${PREFIX} +uninstall: + $(Q) echo " UNINSTALL " ${DESTDIR}${PREFIX} $(Q) ${RM} ${DESTDIR}${PREFIX}/bin/pkgit $(Q) ${RM} ${DESTDIR}${PREFIX}/share/man/man1/pkgit.1 - + defconfig: - $(Q) @if [ "$$(id -u)" -eq 0 ]; then dir=/etc/pkgit; else dir=~/.config/pkgit; fi; \ - $(Q) echo "installing default config to $$dir ..."; \ - $(Q) mkdir -p $$dir; \ - $(Q) cp -r ./config/* $$dir/; \ - $(Q) echo "default config installed" - + $(Q) if [ "$$(id -u)" -eq 0 ]; then dir=/etc/pkgit; else dir="$$HOME/.config/pkgit"; fi; \ + echo "installing default config to $$dir ..."; \ + mkdir -p "$$dir"; \ + cp -r ./config/* "$$dir/"; \ + echo "default config installed" + rmconfig: - $(Q) @if [ "$$(id -u)" -eq 0 ]; then dir=/etc/pkgit; else dir=~/.config/pkgit; fi; \ - $(Q) echo "removing config from $$dir ..."; \ - $(Q) rm -rf $$dir; \ - $(Q) echo "config successfully removed" - + $(Q) if [ "$$(id -u)" -eq 0 ]; then dir=/etc/pkgit; else dir="$$HOME/.config/pkgit"; fi; \ + echo "removing config from $$dir ..."; \ + rm -rf "$$dir"; \ + echo "config successfully removed" + clean: - $(E) " CLEAN" + $(Q) echo " CLEAN" $(Q) ${RM} -r $(OBJDIR) pkgit |
