845f41a85c
This patch adds compiler flags to improve the security of STX code. Flags added: Format string vulnerabilities: CFLAGS="-Wformat -Wformat-security" Compiler will treat string format warnings as errors, so at compiling level, buffer overflow is avoided. Story: 2004380 Task: 28806 Signed-off-by: Luis Botello <luis.botello.ortega@intel.com> Reviewed-by: Erich Cordoba <erich.cordoba.malibran@intel.com> Victor Rodriguez <vm.rod25@gmail.com> Sugested-by: Victor Rodriguez <vm.rod25@gmail.com> Erich Cordoba <erich.cordoba.malibran@intel.com> Change-Id: Ia1ffaf18e7050d9099b80f9023b2bf255b4750fa
39 lines
966 B
Makefile
Executable File
39 lines
966 B
Makefile
Executable File
SRCS = fm_main.cpp
|
|
OBJS = fm_main.o
|
|
|
|
OBJS = $(SRCS:.cpp=.o)
|
|
INCLUDES = -I.
|
|
CCFLAGS = -g -O2 -Wall -Werror
|
|
EXTRACCFLAGS = -Wformat -Wformat-security
|
|
|
|
MAJOR ?= 1
|
|
MINOR ?= 0
|
|
|
|
DESTDIR ?= /
|
|
BINDIR ?= /usr/local/bin
|
|
SYSCONFDIR ?= /etc
|
|
UNITDIR ?= /usr/lib/systemd/system
|
|
|
|
|
|
build: fmManager
|
|
|
|
.cpp.o:
|
|
$(CXX) $(INCLUDES) $(CCFLAGS) $(EXTRACCFLAGS) -c $< -o $@
|
|
|
|
fmManager: $(OBJS)
|
|
$(CXX) -o $@ $(OBJS) $(LDFLAGS) -lfmcommon -lrt -lpthread -luuid
|
|
|
|
clean:
|
|
@rm -f $(OBJS)
|
|
|
|
install:
|
|
mkdir -p $(DESTDIR)/usr/lib/systemd/system
|
|
install -m 755 -d $(DESTDIR)$(SYSCONFDIR)
|
|
install -m 755 -d $(DESTDIR)$(SYSCONFDIR)/init.d
|
|
install -m 755 -d $(DESTDIR)$(SYSCONFDIR)/logrotate.d
|
|
install -m 755 -d $(DESTDIR)$(BINDIR)
|
|
install -m 755 fminit $(DESTDIR)$(SYSCONFDIR)/init.d/fminit
|
|
install -m 755 fmManager $(DESTDIR)$(BINDIR)/fmManager
|
|
install -m 644 fm.logrotate $(DESTDIR)$(SYSCONFDIR)/logrotate.d/fm.logrotate
|
|
install -m 644 fminit.service $(DESTDIR)$(UNITDIR)/fminit.service
|