make install skeleton

This commit is contained in:
Philippe Teuwen 2019-08-30 21:44:40 +02:00
parent dbc9865c36
commit b5f5b9276f
7 changed files with 51 additions and 8 deletions

View file

@ -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"

View file

@ -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 $@))

View file

@ -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:

View file

@ -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:

View file

@ -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 $* = $($*)

View file

@ -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

View file

@ -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