Commit f1514fd3 authored by Vaibhav Gupta's avatar Vaibhav Gupta

tools: Add/Update recipe for 'install'

Signed-off-by: 's avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
parent 9a3d80e9
......@@ -8,8 +8,7 @@
-include Makefile.specific
DESTDIR ?= /usr/local/
LIB = ./lib/
LIB = ./lib
TOOLS = lsfmc \
fmc-slot-eeprom
......@@ -18,8 +17,7 @@ CFLAGS += -ggdb -I. -I$(LIB) -I../include/uapi/ -I../kernel -Wall -Werror $(EXTR
GIT_VERSION := $(shell git describe --dirty --long --tags)
CFLAGS += -DGIT_VERSION="\"$(GIT_VERSION)\""
LDFLAGS += -L$(LIB)
LDLIBS += -lfmc
LDLIBS += $(LIB)/libfmc.a
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
......@@ -27,7 +25,7 @@ FLAWFINDER ?= flawfinder
all: $(TOOLS)
$(TOOLS): $(COMMON_SRCS:.c=.o) $(LIB)/libfmc.a
$(TOOLS): $(LIB)/libfmc.a
$(LIB)/libfmc.a:
@$(MAKE) -C $(shell dirname $@)
......@@ -36,9 +34,14 @@ clean cleanall:
@$(MAKE) -C $(LIB) $@
rm -f $(TOOLS)
install:
install -d $(DESTDIR)/bin
install -D $(TOOLS) $(DESTDIR)/bin
DESTDIR ?=
prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
install: all
mkdir -m 0775 -p $(DESTDIR)$(bindir)
install -D -t $(DESTDIR)$(bindir) -m 0755 $(TOOLS)
cppcheck:
@$(MAKE) -C $(LIB) $@
......
......@@ -22,14 +22,12 @@ CFLAGS += -fPIC
CFLAGS += -DGIT_VERSION="\"$(GIT_VERSION)\""
CFLAGS += $(EXTRACFLAGS)
DESTDIR ?= /usr/local
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: lib
lib: $(LIB) $(LIBS_XYZ)
lib: $(LIB) $(LIBS_XYZ) $(LIBS)
%: %.c $(LIB)
$(CC) $(CFLAGS) $*.c $(LDFLAGS) -o $@
......@@ -38,23 +36,30 @@ $(LIB): $(LOBJ)
$(AR) r $@ $^
$(LIBS_XYZ): $(LIB)
$(CC) -shared -o $@ -Wl,--whole-archive,-soname,$@ $^ -Wl,--no-whole-archive
$(CC) -shared -o $@ -Wl,--whole-archive,-soname,$(LIBS).$(SO_VERSION_X) $^ -Wl,--no-whole-archive
$(LIBS): $(LIBS_XYZ)
ln -sf $< $@
clean cleanall:
rm -f $(LIB) $(LIBS_XYZ) .depend *.o *~
rm -f $(LIB) $(LIBS_XYZ) $(LIBS) .depend *.o *~
.depend: Makefile $(wildcard *.c *.h ../*.h)
$(CC) $(CFLAGS) -M $(LOBJ:.o=.c) -o $@
install:
install -d $(DESTDIR)/lib
install -d $(DESTDIR)/include/fmc
install -m 644 -D $(LIB) $(DESTDIR)/lib
install -m 0755 $(LIBS_XYZ) $(DESTDIR)/lib
install -m 644 -D libfmc.h $(DESTDIR)/include/fmc
ln -sf $(LIBS_XYZ) $(DESTDIR)/lib/$(LIBS).$(SO_VERSION_X)
ln -sf $(LIBS).$(SO_VERSION_X) $(DESTDIR)/lib/$(LIBS)
DESTDIR ?=
prefix ?= /usr/local
libdir ?= $(prefix)/lib
includedir ?= $(prefix)/include
install: $(LIB) $(LIBS) $(LIBS_XYZ)
mkdir -m 0775 -p $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/fmc/linux/ipmi $(DESTDIR)$(includedir)/fmc/fmc
install -D -t $(DESTDIR)$(libdir) -m 0644 $(LIB)
install -D -t $(DESTDIR)$(libdir) -m 0755 $(LIBS_XYZ)
install -D -t $(DESTDIR)$(includedir)/fmc/fmc -m 0644 fmc/core.h
install -D -t $(DESTDIR)$(includedir)/fmc/linux/ipmi -m 0644 ../../include/uapi/linux/ipmi/fru.h
cp -d $(LIBS) $(DESTDIR)$(libdir)
modules_install:
......
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