summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorvishwa <vishwanath@in.ibm.com>2015-11-10 12:10:38 -0600
committervishwa <vishwanath@in.ibm.com>2015-11-24 10:20:04 -0600
commit13555bd0db6c5436b8630ff368537adce11f9968 (patch)
treeaaa89e6bb863f6541d9421932f9368076f7b6a08 /Makefile
parent1c779b8570849a52dac828538c36a59798f4583a (diff)
downloadipmi-fru-parser-13555bd0db6c5436b8630ff368537adce11f9968.tar.gz
ipmi-fru-parser-13555bd0db6c5436b8630ff368537adce11f9968.zip
eeprom read CLI
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 23 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index f56eba3..07bbf5a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,33 @@
-LIBS += libwritefrudata.so
-libwritefrudata.so_OBJS += frup.o writefrudata.o
-libwritefrudata.so_NEEDED += libsystemd
+LIBS += libwritefrudata.so
+HOST_LIBS += libstrgfnhandler.so
+libwritefrudata.so_OBJS += frup.o writefrudata.o
+libstrgfnhandler.so_OBJS += strgfnhandler.o
+
+EXES += phosphor-read-eeprom
+
+phosphor-read-eeprom_OBJS += readeeprom.o argument.o
+phosphor-read-eeprom_EXTRA_LIBS += writefrudata
+libstrgfnhandler.so_EXTRA_LIBS += writefrudata
+libwritefrudata.so_NEEDED += libsystemd
+phosphor-read-eeprom_NEEDED += libsystemd
#### -----------------------------------------------------------------------####
# #
## Compilare Regulas Sequi ##
# #
#### -----------------------------------------------------------------------####
-OPTFLAGS ?= -O3 -g -pipe
+OPTFLAGS ?= -O3 -g -pipe -G -K
CFLAGS ?= $(OPTFLAGS)
CXXFLAGS ?= $(OPTFLAGS)
CFLAGS += -Wall -flto -fPIC
CXXFLAGS += --std=gnu++14 -Wall -flto -fPIC
__PKG_CONFIG = $(if $1,$(shell pkg-config $2 $1))
+__EXTRA_LIB_RESOLV = $(if $1,$1)
define __BUILD_EXE
-$1 : $$($1_OBJS) $$(LIBS)
- $$(LINK.cpp) -o $$@ $$^ $(call __PKG_CONFIG,$($1_NEEDED),--libs)
+$1 : $$($1_OBJS) | $$(LIBS) $$(HOST_LIBS)
+ $$(LINK.cpp) -o $$@ $$^ $(call __EXTRA_LIB_RESOLV,$(addprefix -l,$($1_EXTRA_LIBS))) -L. $(call __PKG_CONFIG,$($1_NEEDED),--libs)
$(eval CXXFLAGS += $(call __PKG_CONFIG,$($1_NEEDED),--cflags))
@@ -27,8 +37,8 @@ endef
$(foreach exe,$(EXES),$(eval $(call __BUILD_EXE,$(exe))))
define __BUILD_LIB
-$1 : $$($1_OBJS)
- $$(LINK.cpp) -shared -o $$@ $$^ $(call __PKG_CONFIG,$($1_NEEDED),--libs)
+$1 : $$($1_OBJS) | $$(addsuffix .so,$$(addprefix lib,$$($1_EXTRA_LIBS)))
+ $$(LINK.cpp) -fPIC -shared -o $$@ $$^ $(call __EXTRA_LIB_RESOLV,$(addprefix -l,$($1_EXTRA_LIBS))) -L. $(call __PKG_CONFIG,$($1_NEEDED),--libs)
$(eval CXXFLAGS += $(call __PKG_CONFIG,$($1_NEEDED),--cflags))
@@ -36,11 +46,13 @@ $(eval CXXFLAGS += $(call __PKG_CONFIG,$($1_NEEDED),--cflags))
endef
$(foreach lib,$(LIBS),$(eval $(call __BUILD_LIB,$(lib))))
+$(foreach lib,$(HOST_LIBS),$(eval $(call __BUILD_LIB,$(lib))))
.PHONY: clean
clean:
$(RM) $(foreach exe,$(EXES),$(exe) $($(exe)_OBJS)) \
- $(foreach lib,$(LIBS),$(lib) $($(lib)_OBJS))
+ $(foreach lib,$(LIBS),$(lib) $($(lib)_OBJS)) \
+ $(foreach lib,$(HOST_LIBS),$(lib) $($(lib)_OBJS))
DESTDIR ?= /
BINDIR ?= /usr/bin
@@ -54,7 +66,8 @@ install:
)
$(if $(LIBS),\
install -m 0755 -d $(DESTDIR)$(LIBDIR)/host-ipmid && \
- install -m 0755 $(LIBS) $(DESTDIR)$(LIBDIR)/host-ipmid \
+ install -m 0755 $(HOST_LIBS) $(DESTDIR)$(LIBDIR)/host-ipmid \
+ install -m 0755 $(LIBS) $(DESTDIR)$(LIBDIR) \
)
.DEFAULT_GOAL: all
OpenPOWER on IntegriCloud