Files
graphene/LibOS/shim/test/native/Makefile
Isaku Yamahata 4a63e6a577 [LibOS/benchmark] make LibOS/shim/tests/benchmark build again
This patch fixes up to make LibOS/shim/tests/benchmark build again.
It addresses small 4 issues as follows.

- Runtime/pal_loader
  pass --no-print-directory to make pal_loader doesn't work as
  expected when it's invoked by make command as below.  pal_loader
  invokes make with --quiet. But when pal_loader is called by make as
  sub command, the message, "Entering/Leaving <dir>" is still output.
  pass --no-print-directory to make to suppress Entering/Leaving
  message.

  > /graphene/Runtime/pal-make[1]: Entering
  > directory '/graphene/Pal/test'
  > Linux
  > make[1]: Leaving directory
  > '/graphene/devel/graphene/Pal/test' is not built, or
  > security mode is not supported

- fix up Makefiles to build LibOS/shim/tests/benchmark
  Otherwise the build fails as follows.
  > $ make
  > ln -sf ../../../../Runtime/pal_loader
  > [ fork_latency ]
  > [ test_start.m ]
  > [ rpc_latency.libos ]
  > /usr/bin/ld: cannot find -llibos
  > collect2: error: ld returned 1 exit status
  > Makefile:18: recipe for target 'rpc_latency.libos' failed
  > make: *** [rpc_latency.libos] Error 1

- update stale manifest.template

- update .gitignore
  The change set of 7f5a4cc made Makefile create .lib directory.
  So add it to .gitignore.

Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
2019-01-22 23:06:45 +01:00

36 lines
1.2 KiB
Makefile

special_executables = static pie
c_executables = $(filter-out $(special_executables),$(patsubst %.c,%,$(wildcard *.c)))
cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
manifests = $(patsubst %.template,%,$(wildcard *.manifest.template)) manifest
exec_target = $(special_executables) $(c_executables) $(cxx_executables) ls.manifest
target = $(exec_target) $(manifests)
level = ../
include ../Makefile
ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
$(c_executables): %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) $(if $(findstring .libos,$@),$(CFLAGS-libos),) -o $@ $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
$(cxx_executables): %: %.cpp
@echo [ $@ ]
@$(CC) $(CFLAGS) $(if $(findstring .libos,$@),$(CFLAGS-libos),) -o $@ $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
static: %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) -o $@ -static $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
pie: %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) -fPIC --pie -o $@ $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
else
.IGNORE: $(special_executables) $(c_executables) $(cxx_executables)
$(special_executables) $(c_executables) $(cxx_executables):
endif