Преглед на файлове

[LibOS,Pal] Move makefile libraries under Scripts/

This commit moves Makefile.configs, Makefile.rules, and Makefile.Test
under Scripts/ and adjusts their includes.
Isaku Yamahata преди 4 години
родител
ревизия
732712e23e

+ 1 - 1
LibOS/Makefile

@@ -38,7 +38,7 @@ export GLIBC_CFLAGS
 all: $(GLIBC_TARGET) $(GLIBC_RUNTIME)
 	$(MAKE) -C $(SHIM_DIR) all
 
-include ../Makefile.rules
+include ../Scripts/Makefile.rules
 
 .PHONY: format
 format:

+ 3 - 3
LibOS/shim/src/Makefile

@@ -1,11 +1,11 @@
 RUNTIME_DIR = $(CURDIR)/../../../Runtime
 
-include ../../../Makefile.configs
+include ../../../Scripts/Makefile.configs
 include ../../../Pal/src/Makefile.Host
 
 OMIT_FRAME_POINTER = no
 
-CFLAGS	= -Wall -fPIC -std=c11 -Winline -Wwrite-strings \
+CFLAGS = -Wall -fPIC -std=c11 -Winline -Wwrite-strings \
 	  -fmerge-all-constants -Wstrict-prototypes -Wtrampolines \
 	  -Werror=implicit-function-declaration \
 	  $(cc-option, -Wnull-dereference) \
@@ -123,7 +123,7 @@ endif
 
 syscallas.S shim_checkpoint.c: asm-offsets.h
 
-include ../../../Makefile.rules
+include ../../../Scripts/Makefile.rules
 
 LDFLAGS-vdso/vdso.so.dbg = -nostdlib -shared \
 	--hash-style=both --build-id -Bsymbolic \

+ 1 - 1
LibOS/shim/test/benchmark/Makefile

@@ -4,7 +4,7 @@ cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
 exec_target = $(c_executables) $(cxx_executables)
 target = manifest
 
-include ../Makefile.Test
+include ../../../../Scripts/Makefile.Test
 
 %.manifest: %.manifest.template
 	rm -rf $@

+ 1 - 1
LibOS/shim/test/fs/Makefile

@@ -10,7 +10,7 @@ clean-extra += clean-tmp
 .PHONY: default
 default: all
 
-include ../Makefile.Test
+include ../../../../Scripts/Makefile.Test
 
 ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
 

+ 1 - 1
LibOS/shim/test/inline/Makefile

@@ -7,7 +7,7 @@ target = $(c_executables) $(cxx_executables) manifest
 .PHONY: default
 default: all
 
-include ../Makefile.Test
+include ../../../../Scripts/Makefile.Test
 
 $(PALDIR)/user_start.o: $(PALDIR)/user_start.S
 	$(MAKE) -C $(PALDIR) $(notdir $@)

+ 1 - 1
LibOS/shim/test/native/Makefile

@@ -5,7 +5,7 @@ manifests = $(patsubst %.template,%,$(wildcard *.manifest.template)) manifest
 exec_target = $(c_executables) $(cxx_executables) ls.manifest
 target = $(exec_target) $(manifests)
 
-include ../Makefile.Test
+include ../../../../Scripts/Makefile.Test
 
 ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
 

+ 1 - 1
LibOS/shim/test/regression/Makefile

@@ -10,7 +10,7 @@ clean-extra += clean-tmp
 .PHONY: default
 default: all
 
-include ../Makefile.Test
+include ../../../../Scripts/Makefile.Test
 
 ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
 

+ 2 - 2
LibOS/shim/test/regression/exec_victim.manifest.template

@@ -15,5 +15,5 @@ sys.brk.size = 32M
 sys.stack.size = 4M
 
 # sgx-related
-sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
-sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6
+sgx.trusted_files.ld = file:../../../../Runtime/ld-linux-x86-64.so.2
+sgx.trusted_files.libc = file:../../../../Runtime/libc.so.6

+ 2 - 2
Pal/lib/Makefile

@@ -1,5 +1,5 @@
-include ../../Makefile.configs
-include ../../Makefile.rules
+include ../../Scripts/Makefile.configs
+include ../../Scripts/Makefile.rules
 include ../src/Makefile.Host
 
 CFLAGS	= -Wall -fPIC -O2 -std=gnu99 -fgnu89-inline -U_FORTIFY_SOURCE \

+ 2 - 2
Pal/regression/Makefile

@@ -15,8 +15,8 @@ pal_lib = ../../Runtime/libpal-$(PAL_HOST).so
 
 .PHONY: default
 default: all
-include ../../Makefile.configs
-include ../../Makefile.rules
+include ../../Scripts/Makefile.configs
+include ../../Scripts/Makefile.rules
 include ../src/Makefile.Test
 
 RUNTIME_DIR = $(CURDIR)/../../Runtime

+ 2 - 2
Pal/src/Makefile

@@ -1,8 +1,8 @@
 export PAL_DIR = $(CURDIR)
 export RUNTIME_DIR = $(CURDIR)/../../Runtime
 
-include ../../Makefile.configs
-include ../../Makefile.rules
+include ../../Scripts/Makefile.configs
+include ../../Scripts/Makefile.rules
 include Makefile.Host
 
 # Customizable PAL Targets

+ 2 - 2
Pal/src/host/Linux-SGX/Makefile

@@ -1,4 +1,4 @@
-include ../../../../Makefile.configs
+include ../../../../Scripts/Makefile.configs
 include Makefile.am
 
 ias_cert_url ?= https://certificates.trustedservices.intel.com/Intel_SGX_Attestation_RootCA.pem
@@ -93,7 +93,7 @@ ifeq ($(filter %clean,$(MAKECMDGOALS)),)
 include $(wildcard *.d) $(wildcard debugger/*.d)
 endif
 
-include ../../../../Makefile.rules
+include ../../../../Scripts/Makefile.rules
 
 CLEAN_FILES += $(notdir $(pal_static) $(pal_lib) $(pal_loader))
 CLEAN_FILES += debugger/sgx_gdb.o

+ 2 - 2
Pal/src/host/Linux/Makefile

@@ -1,4 +1,4 @@
-include ../../../../Makefile.configs
+include ../../../../Scripts/Makefile.configs
 include Makefile.am
 
 CFLAGS	+= -I. -Iinclude -I../.. -I../../../include -I../../../lib \
@@ -46,7 +46,7 @@ libpal-Linux.a: $(addsuffix .o,$(objs)) $(graphene_lib)
 %.s: %.S
 	$(call cmd,cpp_s_S)
 
-include ../../../../Makefile.rules
+include ../../../../Scripts/Makefile.rules
 
 ifeq ($(filter %clean,$(MAKECMDGOALS)),)
 -include $(addsuffix .d,$(objs)) $(addsuffix .i.d,$(objs)) $(addsuffix .s.d,$(objs))

+ 2 - 2
Pal/src/host/Skeleton/Makefile

@@ -1,4 +1,4 @@
-include ../../../../Makefile.configs
+include ../../../../Scripts/Makefile.configs
 include Makefile.am
 
 CFLAGS  += -I. -I../.. -I../../../include -I../../../lib
@@ -34,7 +34,7 @@ libpal-Skeleton.a: $(addsuffix .o,$(objs))
 %.o: %.S $(headers)
 	$(call cmd,as_o_S)
 
-include ../../../../Makefile.rules
+include ../../../../Scripts/Makefile.rules
 
 .PHONY: clean
 clean:

+ 2 - 2
Pal/test/Makefile

@@ -6,8 +6,8 @@ CFLAGS	= -Wall -O2 -std=c11 -fno-builtin -nostdlib -no-pie \
 
 .PHONY: default
 default: all
-include ../../Makefile.configs
-include ../../Makefile.rules
+include ../../Scripts/Makefile.configs
+include ../../Scripts/Makefile.rules
 include ../src/Makefile.Test
 
 executables = HelloWorld File Failure Thread Fork Event Process Exception \

+ 11 - 10
LibOS/shim/test/Makefile.Test → Scripts/Makefile.Test

@@ -1,11 +1,12 @@
-SHIM_TEST_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
+SCRIPTS_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
+SHIM_TEST_DIR = $(SCRIPTS_DIR)/../LibOS/shim/test
 
 SYS ?= $(shell gcc -dumpmachine)
 export SYS
 
-PALDIR  = $(SHIM_TEST_DIR)/../../../Pal/src
-SHIMDIR = $(SHIM_TEST_DIR)/../src
-RUNTIME = $(SHIM_TEST_DIR)/../../../Runtime
+PALDIR  = $(abspath $(SCRIPTS_DIR)/../Pal/src)
+SHIMDIR = $(abspath $(SCRIPTS_DIR)/../LibOS/shim)
+RUNTIME = $(abspath $(SCRIPTS_DIR)/../Runtime)
 
 ifeq ($(SGX),1)
 PAL_LOADER = pal_loader SGX
@@ -19,17 +20,17 @@ CFLAGS 	= -Wall -std=gnu99
 CXXFLAGS = -Wall -std=c++14
 LDFLAGS	=
 
-CFLAGS-libos = -I$(SHIMDIR)/../include -L$(SHIMDIR)/../../glibc-build/libos
+CFLAGS-libos = -I$(SHIMDIR)/include -L$(SHIMDIR)/../glibc-build/libos
 
-CFLAGS-libos-debug = -I$(SHIMDIR)/../include -I$(PALDIR)/../include/pal -I$(PALDIR)/../lib -fno-builtin -nostdlib
-CXXFLAGS-libos-debug = -I$(SHIMDIR)/../include -I$(PALDIR)/../include/pal -I$(PALDIR)/../lib -fno-builtin -nostdlib
-LDFLAGS-libos-debug = -L$(SHIMDIR) -L$(PALDIR)/host/$(PAL_HOST) -Wl,-rpath-link=$(abspath $(RUNTIME)) -lpal -lsysdb_debug
+CFLAGS-libos-debug = -I$(SHIMDIR)/include -I$(PALDIR)/../include/pal -I$(PALDIR)/../lib -fno-builtin -nostdlib
+CXXFLAGS-libos-debug = -I$(SHIMDIR)/include -I$(PALDIR)/../include/pal -I$(PALDIR)/../lib -fno-builtin -nostdlib
+LDFLAGS-libos-debug = -L$(SHIMDIR)/src -L$(PALDIR)/host/$(PAL_HOST) -Wl,-rpath-link=$(abspath $(RUNTIME)) -lpal -lsysdb_debug
 
 .PHONY: default
 default: all
 
-include $(SHIM_TEST_DIR)/../../../Makefile.configs
-include $(SHIM_TEST_DIR)/../../../Makefile.rules
+include $(SCRIPTS_DIR)/Makefile.configs
+include $(SCRIPTS_DIR)/Makefile.rules
 include $(PALDIR)/Makefile.Test
 
 .PHONY: all

+ 0 - 0
Makefile.configs → Scripts/Makefile.configs


+ 5 - 5
Makefile.rules → Scripts/Makefile.rules

@@ -116,12 +116,12 @@ quiet_cmd_check_no_reloc = [ check_no_reloc $^ ]
       cmd_check_no_reloc = LC_ALL=C readelf -r $^ | grep -q 'There are no relocations in this file.'
 
 # single .c => executable
-quiet_cmd_csingle  = [ $@ ]
-      cmd_csingle  = $(CC) -MD -MP $(CFLAGS) $(CFLAGS-$@) -o $@ $< $(LDLIBS) $(LDLIBS-$@)
+quiet_cmd_csingle = [ $@ ]
+      cmd_csingle = $(CC) -MD -MP $(CFLAGS) $(CFLAGS-$@) -o $@ $< $(LDLIBS) $(LDLIBS-$@)
 
 # single .cpp => executable
-quiet_cmd_cxxsingle  = [ $@ ]
-      cmd_cxxsingle  = $(CXX) -MD -MP $(CXXFLAGS) $(CXXFLAGS-$@) -o $@ $< $(LDLIBS) $(LDLIBS-$@)
+quiet_cmd_cxxsingle = [ $@ ]
+      cmd_cxxsingle = $(CXX) -MD -MP $(CXXFLAGS) $(CXXFLAGS-$@) -o $@ $< $(LDLIBS) $(LDLIBS-$@)
 
 # sgx sign
 quiet_cmd_sgx_sign_exec = [ $*.{sig, manifest.sgx} ]
@@ -144,7 +144,7 @@ quiet_cmd_sgx_sign_depend = [ $@ ]
       cmd_sgx_sign_depend = $(SGX_SIGN) -depend -output $@ -manifest $<
 
 # pal map
-PAL_SYMBOL_FILE := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))Pal/src/pal-symbols
+PAL_SYMBOL_FILE := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../Pal/src/pal-symbols
 PAL_SYMBOLS = $(shell sed -e 's|$$|;|g' $(PAL_SYMBOL_FILE))
 
 quiet_cmd_pal_map = [ $@ ]