From b5f5b9276f2fc39a8ea18e3ab5a0eabf7faa7bd0 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 30 Aug 2019 21:44:40 +0200 Subject: [PATCH] make install skeleton --- Makefile | 5 +++-- Makefile.host | 10 +++++++++- armsrc/Makefile | 10 +++++++++- bootrom/Makefile | 10 +++++++++- client/Makefile | 10 +++++++++- common_arm/Makefile.common | 5 +++-- recovery/Makefile | 9 +++++++++ 7 files changed, 51 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 7ca9e313f..3f288f504 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,13 @@ ifneq ($(V),1) endif # To see full command lines, use make V=1 +COPY=cp GZIP=gzip -include Makefile.platform -include .Makefile.options.cache include common_arm/Makefile.hal -all clean: %: client/% bootrom/% armsrc/% recovery/% mfkey/% nonce2key/% fpga_compress/% +all clean install uninstall: %: client/% bootrom/% armsrc/% recovery/% mfkey/% nonce2key/% fpga_compress/% mfkey/%: FORCE $(info [*] MAKE $@) @@ -34,7 +35,7 @@ recovery/%: FORCE cleanifplatformchanged bootrom/% armsrc/% $(Q)$(MAKE) --no-print-directory -C recovery $(patsubst recovery/%,%,$@) FORCE: # Dummy target to force remake in the subdirectories, even if files exist (this Makefile doesn't know about the prerequisites) -.PHONY: all clean help _test bootrom fullimage recovery client mfkey nonce2key style checks FORCE udev accessrights cleanifplatformchanged +.PHONY: all clean install uninstall help _test bootrom fullimage recovery client mfkey nonce2key style checks FORCE udev accessrights cleanifplatformchanged help: @echo "Multi-OS Makefile" diff --git a/Makefile.host b/Makefile.host index 66f3ccce0..8e76caa50 100644 --- a/Makefile.host +++ b/Makefile.host @@ -48,7 +48,15 @@ clean: $(Q)$(RM) $(CLEAN) $(Q)$(RMDIR) $(OBJDIR) -.PHONY: all clean +install: all + $(info [@] Installing $(BINS) $(LIB_A) to $(PREFIX)) + @true + +uninstall: + $(info [@] Uninstalling $(BINS) $(LIB_A) from $(PREFIX)) + @true + +.PHONY: all clean install uninstall $(BINDIR)/$(LIB_A): $(MYOBJS) $(info [=] AR $(notdir $@)) diff --git a/armsrc/Makefile b/armsrc/Makefile index 048879d96..6e67913e4 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -213,7 +213,15 @@ clean: $(Q)$(DELETE) $(OBJDIR)$(PATHSEP)*.bin $(Q)$(DELETE) version.c -.PHONY: all clean help +install: all + $(info [@] Installing fullimage to $(PREFIX)) + @true + +uninstall: + $(info [@] Uninstalling fullimage from $(PREFIX)) + @true + +.PHONY: all clean help install uninstall help: @echo Multi-OS Makefile, you are running on $(DETECTED_OS) @echo Possible targets: diff --git a/bootrom/Makefile b/bootrom/Makefile index 884f01757..179678b92 100644 --- a/bootrom/Makefile +++ b/bootrom/Makefile @@ -56,7 +56,15 @@ clean: $(Q)$(DELETE) $(OBJDIR)$(PATHSEP)*.d $(Q)$(DELETE) version.c -.PHONY: all clean help +install: all + $(info [@] Installing bootrom to $(PREFIX)) + @true + +uninstall: + $(info [@] Uninstalling bootrom from $(PREFIX)) + @true + +.PHONY: all clean help install help: @echo Multi-OS Makefile, you are running on $(DETECTED_OS) @echo Possible targets: diff --git a/client/Makefile b/client/Makefile index 4a2e12329..42e617e1f 100644 --- a/client/Makefile +++ b/client/Makefile @@ -334,6 +334,14 @@ clean: $(Q)$(MAKE) --no-print-directory -C $(CBORLIBPATH) clean $(Q)$(MAKE) --no-print-directory -C $(REVENGPATH) clean +install: all + $(info [@] Installing client to $(PREFIX)) + @true + +uninstall: + $(info [@] Uninstalling client from $(PREFIX)) + @true + tarbin: $(BINS) $(info [=] TAR ../proxmark3-$(platform)-bin.tar) $(Q)$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%) $(WINBINS:%=client/%) @@ -364,7 +372,7 @@ $(ZLIB): $(info [*] MAKE zlib) $(Q)$(MAKE) --no-print-directory -C $(ZLIBPATH) OBJDIR=$(ROOT_DIR)$(OBJDIR) BINDIR=$(ROOT_DIR)$(OBJDIR) all -.PHONY: all clean +.PHONY: all clean install uninstall # easy printing of MAKE VARIABLES print-%: ; @echo $* = $($*) diff --git a/common_arm/Makefile.common b/common_arm/Makefile.common index b2f085d56..011f020f8 100644 --- a/common_arm/Makefile.common +++ b/common_arm/Makefile.common @@ -21,10 +21,11 @@ endif # Make sure that all is the default target # (The including Makefile still needs to define what 'all' is) -platform = $(shell uname) - all: +platform = $(shell uname) +PREFIX?=/usr/local + CROSS ?= arm-none-eabi- CC = $(CROSS)gcc AS = $(CROSS)as diff --git a/recovery/Makefile b/recovery/Makefile index 59f7f37c8..60b62cfe1 100644 --- a/recovery/Makefile +++ b/recovery/Makefile @@ -19,3 +19,12 @@ proxmark3_recovery.bin: bootrom.bin fullimage.bin clean: $(Q)rm -f $(BINS) +install: all + $(info [@] Installing recovery to $(PREFIX)) + @true + +uninstall: all + $(info [@] Uninstalling recovery from $(PREFIX)) + @true + +PHONY: all clean install uninstall