Skip to content

Commit

Permalink
Use which to find ulp files when compiling examples
Browse files Browse the repository at this point in the history
'configure' set default target installation directory is '/usr/local/bin/ulp',
at the same time, ulp could be installed to '/usr/bin/', thus, we should find
ulp in examples/*/Makefile, it's better way.

Signed-off-by: Rong Tao <[email protected]>
  • Loading branch information
Rtoax committed Oct 13, 2023
1 parent f1faf19 commit fcafc96
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
6 changes: 5 additions & 1 deletion examples/cplusplus/1-class/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
CXX=g++
CXXFLAGS=-O2 -fpatchable-function-entry=16,14 -fPIC -g3
ULP=/usr/bin/ulp
ULP=$(shell which ulp 2>/dev/null)
LDFLAGS=

ifeq ($(ULP),)
$(error Not found ulp, please make install first)
endif

all: test a_livepatch1.so

test: class.o
Expand Down
6 changes: 5 additions & 1 deletion examples/cplusplus/2-private_class/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
CXX=g++
CXXFLAGS=-O2 -fpatchable-function-entry=16,14 -fdump-ipa-clones -fPIC -g3
ULP=/usr/bin/ulp
ULP=$(shell which ulp 2>/dev/null)
LDFLAGS=

ifeq ($(ULP),)
$(error Not found ulp, please make install first)
endif

all: test a_livepatch1.so

test: class.o
Expand Down
6 changes: 5 additions & 1 deletion examples/cplusplus/3-indirect_call/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
CXX=g++
CXXFLAGS=-O2 -fpatchable-function-entry=16,14 -fdump-ipa-clones -fPIC -g3
ULP=/usr/bin/ulp
ULP=$(shell which ulp 2>/dev/null)
LDFLAGS=

ifeq ($(ULP),)
$(error Not found ulp, please make install first)
endif

all: test a_livepatch1.so

test: class.o
Expand Down
6 changes: 5 additions & 1 deletion examples/cplusplus/4-global_var/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
CXX=g++
CXXFLAGS=-O2 -fpatchable-function-entry=16,14 -fdump-ipa-clones -fPIC -g3
ULP=/usr/bin/ulp
ULP=$(shell which ulp 2>/dev/null)
LDFLAGS=

ifeq ($(ULP),)
$(error Not found ulp, please make install first)
endif

all: test a_livepatch1.so

test: test.o
Expand Down
6 changes: 5 additions & 1 deletion examples/cplusplus/5-queue/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
CXX=g++
CXXFLAGS=-fpatchable-function-entry=16,14 -fdump-ipa-clones -fPIC -g3 -Wno-terminate -O2
ULP=/usr/bin/ulp
ULP=$(shell which ulp 2>/dev/null)
LDFLAGS=

ifeq ($(ULP),)
$(error Not found ulp, please make install first)
endif

all: test a_livepatch1.so

test: class.o
Expand Down

0 comments on commit fcafc96

Please sign in to comment.