Commit 48e2c523 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski Committed by Alessandro Rubini

Makefiles: added install target for tools & the library

parent b58b38f1
......@@ -2,6 +2,8 @@ FMC_BUS := $(shell scripts/check-submodule fmc-bus $(FMC_BUS))
ZIO := $(shell scripts/check-submodule zio $(ZIO))
SPEC_SW := $(shell scripts/check-submodule spec-sw $(SPEC_SW))
DESTDIR ?= /usr/local
.PHONY: all clean modules install modules_install default
.PHONY: gitmodules prereq prereq_install prereq_install_warn
......
# This is not a kbuild Makefile. It is a plain Makefile so it can be copied
ZIO := $(shell cd ..; scripts/check-submodule zio $(ZIO))
LIB = libfdelay.a
LOBJ := fdelay-init.o
LOBJ += fdelay-time.o
......@@ -9,6 +11,8 @@ LOBJ += fdelay-output.o
CFLAGS = -Wall -ggdb -O2 -I../kernel -I$(ZIO)/include
LDFLAGS = -L. -lfdelay
DESTDIR ?= /usr/local
modules all: lib
lib: $(LIB)
......@@ -25,7 +29,15 @@ clean:
.depend: Makefile $(wildcard *.c *.h ../*.h)
$(CC) $(CFLAGS) -M $(LOBJ:.o=.c) -o $@
install modules_install:
install:
install -d $(DESTDIR)/lib
install -d $(DESTDIR)/include/fmc-fdelay
install -m 644 -D $(LIB) $(DESTDIR)/lib
install -m 644 -D fdelay-lib.h $(DESTDIR)/include/fmc-fdelay
install -m 644 -D ../kernel/fine-delay.h $(DESTDIR)/include/fmc-fdelay
modules_install:
-include .depend
......@@ -2,6 +2,8 @@
M = $(shell /bin/pwd)/../kernel
DESTDIR ?= /usr/local
HOST_EXTRACFLAGS += -I$(M) -I../lib -I$(ZIO)/include -Wno-trigraphs -Wall -ggdb
HOSTCC ?= gcc
......@@ -22,7 +24,11 @@ clean:
$(hostprogs-y): tools-util.o tools-common.h $(wildcard ../lib/*.[ch])
# make nothing for modules_install, but avoid errors
modules_install install:
modules_install:
install:
install -d $(DESTDIR)/bin
install -D $(hostprogs-y) $(DESTDIR)/bin
# we need this as we are out of the kernel
%: %.c $(wildcard *.h)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment