tRefine 'install' Makefile target and add 'uninstall' target - cngf-pf - continuum model for granular flows with pore-pressure dynamics (renamed from 1d_fd_simple_shear)
(HTM) git clone git://src.adamsgaard.dk/cngf-pf
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit e9f983205ea05513c2cda4ea4e899b58e22ba258
(DIR) parent 2aa6aa3b8726328f87dd03a7d1dcf8ce4eaffb8a
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Mon, 24 Jun 2019 16:42:30 +0200
Refine 'install' Makefile target and add 'uninstall' target
Diffstat:
M Makefile | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
t@@ -1,15 +1,25 @@
-CFLAGS=-g -std=c99 -pedantic -Wall
-LDFLAGS=-lm
-SRC=$(wildcard *.c)
-OBJ=$(patsubst %.c,%.o,$(SRC))
-HDR=$(wildcard *.h)
+CFLAGS = -g -std=c99 -pedantic -Wall
+LDFLAGS = -lm
+SRC = $(wildcard *.c)
+OBJ = $(patsubst %.c,%.o,$(SRC))
+HDR = $(wildcard *.h)
+BIN = 1d_fd_simple_shear
+
+PREFIX ?= /usr/local
+INSTALL ?= install
+STRIP ?= strip
.PHONY: default
-default: 1d_fd_simple_shear
+default: $(BIN)
.PHONY: install
-install: 1d_fd_simple_shear
- install $< /usr/local/bin/
+install: $(BIN)
+ $(STRIP) $(BIN)
+ $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin
+ $(INSTALL) -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin
+
+uninstall:
+ $(RM) $(DESTDIR)$(PREFIX)/bin/$(BIN)
.PHONY: plots
plots: 1d_fd_simple_shear.png \