This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 260
/
Makefile
79 lines (64 loc) · 2.71 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
special_executables = bootstrap_static bootstrap_pie shared_object openmp
c_executables = $(filter-out $(special_executables),$(patsubst %.c,%,$(wildcard *.c)))
cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
manifests = $(patsubst %.manifest.template,%.manifest,$(wildcard *.manifest.template)) manifest
exec_target = $(special_executables) $(c_executables) $(cxx_executables)
target = $(exec_target) $(manifests)
clean-extra += clean-tmp
.PHONY: default
default: all
level = ../
include ../Makefile
CFLAGS-libos = -L../../../build/libos -I../../include
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) -o $@ $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
bootstrap_static: %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) -o $@ -static $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
bootstrap_pie: %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) -fPIC --pie -o $@ $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
shared_object: %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) -o $@ -fPIC -pie $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
openmp: %: %.c
@echo [ $@ ]
@$(CC) $(CFLAGS) -o $@ -fopenmp $< \
$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
else
.IGNORE: $(special_executables) $(c_executables) $(cxx_executables)
$(special_executables) $(c_executables) $(cxx_executables):
endif
PYTHONENV="PYTHONPATH=../../../../Scripts"
ifeq ($(SGX_RUN),1)
PYTHONENV += "TIMEOUT=20000"
endif
# 30_sigaltstack.py fails because sigaltstack isn't correctly implemented.
BLOCKED_TESTS = \
30_sigaltstack.py
get_tests = $(filter-out $(BLOCKED_TESTS),$(wildcard $(1)))
.PHONY: regression
regression: $(target)
@echo "\n\nBasic Bootstrapping:"
@for f in $(call get_tests,00_*.py); do env $(PYTHONENV) python3 $$f $(RUNTIME)/pal-$(PAL_HOST) || exit $$?; done
@echo "\n\nSyscall Support:"
@for f in $(call get_tests,30_*.py); do env $(PYTHONENV) python3 $$f $(RUNTIME)/pal-$(PAL_HOST) || exit $$?; done
@echo "\n\nFile System Support:"
@for f in $(call get_tests,40_*.py); do env $(PYTHONENV) python3 $$f $(RUNTIME)/pal-$(PAL_HOST) || exit $$?; done
@echo "\n\nSocket Support:"
@for f in $(call get_tests,80_*.py); do env $(PYTHONENV) python3 $$f $(RUNTIME)/pal-$(PAL_HOST) || exit $$?; done
@echo "\n\nLarge File Support:"
@for f in $(call get_tests,90_*.py); do env $(PYTHONENV) python3 $$f $(RUNTIME)/pal-$(PAL_HOST) || exit $$?; done
.PHONY: clean-tmp
clean-tmp:
rm -rf *.tmp ../apps/ltp/*.csv *.cached *.manifest.sgx *~ *.sig *.token