From 4348b127b85c6d8f8fb870635c30a42bfa20d689 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 16 Mar 2012 19:50:52 -0700 Subject: [PATCH] Add 'install' targets Supports both DESTDIR and prefix values; set as you please Signed-off-by: Keith Packard --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 0fbc337..2afbc20 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ # $Id$ +DESTDIR= +prefix=/home/keithp/sat +libdir=$(prefix)/lib +includedir=$(prefix)/include + CC=arm-none-eabi-gcc # This is where you chose which platform to compile for (see 'make links' / './platform') @@ -15,6 +20,7 @@ SRCFILES := $(shell find -L $(PROJDIRS) -type f -name "*.c") BUILDFILES := $(shell find -L build -type f -name "*.c") # All header files of the project HDRFILES := $(shell find -L $(PROJDIRS) -type f -name "*.h") +BUILDHDRFILES := $(shell find -L build -type f -name "*.h") # All .c files in functions/_PDCLIB that do not have a regression test driver INTFILES := _Exit atomax digits open print scan remove rename seed stdinit strtox_main strtox_prelim filemode eol errno seek prepread prepwrite allocpages tmpfilename closeall # All object files in the library @@ -59,6 +65,16 @@ pdclib.a: $(OBJFILES) @ar rc pdclib.a $? @echo +install: install-lib install-hdr + +install-lib: pdclib.a + install -D -c pdclib.a $(DESTDIR)$(libdir)/pdclib.a + +install-hdr: $(BUILDHDRFILES) + for file in $(BUILDHDRFILES); do \ + install -D -c $$file $(DESTDIR)$(includedir)/.; \ + done + test: functions/$(FILE) functions/$(FILE) -- 2.30.2