From 77827c838e36e39471f2f23338f76e5ace2404c4 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Fri, 25 Dec 2015 15:29:12 +0100 Subject: Make installation locations more configurable This might be desired when platform has its own, custom layout (eg. OpenBSD or Solaris), or when user wants to install the program to his home directory. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 2a08f31..5c9c87b 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,12 @@ Installation $ make # make install +Macro `PREFIX` controls installation prefix. If more control over installation +paths is required, macros `BINPREFIX`, `MANPREFIX` and `DATAPREFIX` are +available. Eg. to install `imv` to home directory, run: + + $ BINPREFIX=~/bin PREFIX=~/.local make install + Tests ----- -- cgit v1.2.3 From c42ab088191d5dd8a2d856dc96cb5b3f90687fc4 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Fri, 25 Dec 2015 17:52:01 +0100 Subject: Add verbose mode If V variable is set to any value, commands will be echoed to standard output. --- Makefile | 14 ++++++++------ README.md | 5 +++++ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/Makefile b/Makefile index fb3d07e..6ffa5c5 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ BINPREFIX ?= $(PREFIX)/bin MANPREFIX ?= $(PREFIX)/share/man DATAPREFIX ?= $(PREFIX)/share +V ?= + CFLAGS ?= -W -Wall -Wpedantic CFLAGS += -std=gnu11 $(shell sdl2-config --cflags) LDFLAGS += $(shell sdl2-config --libs) -lfreeimage -lSDL2_ttf -lfontconfig -lpthread @@ -22,26 +24,26 @@ CFLAGS += -DIMV_VERSION=\"$(VERSION)\" $(TARGET): $(OBJECTS) @echo "LINKING $@" - @$(CC) -o $@ $^ $(LDLIBS) $(LDFLAGS) + $(V:%=@)$(CC) -o $@ $^ $(LDLIBS) $(LDFLAGS) debug: CFLAGS += -DDEBUG -g -pg debug: $(TARGET) $(BUILDDIR)/%.o: src/%.c - @mkdir -p $(BUILDDIR) + $(V:%=@)mkdir -p $(BUILDDIR) @echo "COMPILING $@" - @$(CC) -c $(CFLAGS) -o $@ $< + $(V:%=@)$(CC) -c $(CFLAGS) -o $@ $< test_%: test/%.c src/%.c @echo "BUILDING $@" - @$(CC) -o $@ -Isrc -W -Wall -std=gnu11 -lcmocka $^ + $(V:%=@)$(CC) -o $@ -Isrc -W -Wall -std=gnu11 -lcmocka $^ check: $(TESTS) @echo "RUNNING TESTS" - @for t in "$(TESTS)"; do ./$$t; done + $(V:%=@)for t in "$(TESTS)"; do ./$$t; done clean: - @$(RM) $(TARGET) $(OBJECTS) $(TESTS) + $(V:%=@)$(RM) $(TARGET) $(OBJECTS) $(TESTS) install: $(TARGET) install -D -m 0755 $(TARGET) $(DESTDIR)$(BINPREFIX)/imv diff --git a/README.md b/README.md index 5c9c87b..7ed1ff3 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,11 @@ available. Eg. to install `imv` to home directory, run: $ BINPREFIX=~/bin PREFIX=~/.local make install +In case something goes wrong during installation process you may use verbose +mode to inspect commands issued by make: + + $ V=1 make + Tests ----- -- cgit v1.2.3