# Makefile for building LPC21ISP RPM package # Copyright (C)2013-2018, Philip Munts, President, Munts AM Corp. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. LPC21ISP_NAME = lpc21isp LPC21ISP_URL = https://github.com/capiman/lpc21isp.git LPC21ISP_DIR = lpc21isp.src LPC21ISP_PROG = lpc21isp HOST_CC = gcc HOST_CFLAGS += -Wall INSTALLDIR = /usr/local/bin default: $(LPC21ISP_PROG) # Fetch lpc21isp source tree $(LPC21ISP_DIR): git clone --depth 1 $(LPC21ISP_URL) $(LPC21ISP_DIR) # Compile lpc21isp $(LPC21ISP_PROG): $(LPC21ISP_DIR) $(MAKE) -C $(LPC21ISP_DIR) CC=$(HOST_CC) CFLAGS="$(HOST_CFLAGS)" cp $(LPC21ISP_DIR)/lpc21isp $(LPC21ISP_PROG) # Install lpc21isp install: $(LPC21ISP_PROG) install -csm 0555 $(LPC21ISP_PROG) $(INSTALLDIR) # Uninstall lpc21isp uninstall: -rm $(INSTALLDIR)/$(LPC21ISP_PROG) # Clean out working files clean: -$(MAKE) -C $(LPC21ISP_DIR) clean -rm -rf $(LPC21ISP_PROG) reallyclean: clean distclean: reallyclean -rm -rf $(LPC21ISP_DIR)