MAKE: Fix parallel builds; .o files; .gitignore; new makedocs
This commit is contained in:
parent
e01759e2fa
commit
cc2a6bec3c
3 changed files with 45 additions and 26 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
*~
|
*~
|
||||||
|
*.o
|
||||||
/passt
|
/passt
|
||||||
/passt.avx2
|
/passt.avx2
|
||||||
/pasta
|
/pasta
|
||||||
|
|
51
Makefile
51
Makefile
|
@ -100,29 +100,41 @@ else
|
||||||
BIN := passt pasta qrap
|
BIN := passt pasta qrap
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: $(BIN) $(MANPAGES) docs
|
.NOTPARALLEL: seccomp.h
|
||||||
|
all: seccomp.h $(BIN) $(MANPAGES) docs
|
||||||
|
|
||||||
|
PASST_OBJS = $(PASST_SRCS:.c=.o)
|
||||||
|
PASST_AVX2_OBJS = $(PASST_SRCS:.c=.avx2.o)
|
||||||
|
OBJS = $(SRCS:.c=.o)
|
||||||
|
QRAP_OBJS = $(QRAP_SRCS:.c=.o)
|
||||||
|
AVXFLAGS += -Ofast -mavx2 -ftree-vectorize -funroll-loops
|
||||||
|
|
||||||
static: FLAGS += -static -DGLIBC_NO_STATIC_NSS
|
static: FLAGS += -static -DGLIBC_NO_STATIC_NSS
|
||||||
static: clean all
|
static: clean seccomp.h all
|
||||||
|
|
||||||
seccomp.h: seccomp.sh $(PASST_SRCS) $(PASST_HEADERS)
|
seccomp.h: seccomp.sh $(PASST_SRCS) $(PASST_HEADERS)
|
||||||
@ EXTRA_SYSCALLS="$(EXTRA_SYSCALLS)" ARCH="$(TARGET_ARCH)" CC="$(CC)" ./seccomp.sh $(PASST_SRCS) $(PASST_HEADERS)
|
@ EXTRA_SYSCALLS="$(EXTRA_SYSCALLS)" ARCH="$(TARGET_ARCH)" CC="$(CC)" ./seccomp.sh $(PASST_SRCS) $(PASST_HEADERS)
|
||||||
|
|
||||||
passt: $(PASST_SRCS) $(HEADERS)
|
.c.o:
|
||||||
$(CC) $(FLAGS) $(CFLAGS) $(CPPFLAGS) $(PASST_SRCS) -o passt $(LDFLAGS)
|
$(CC) $(FLAGS) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
||||||
|
|
||||||
passt.avx2: FLAGS += -Ofast -mavx2 -ftree-vectorize -funroll-loops
|
$(PASST_AVX2_OBJS): seccomp.h
|
||||||
passt.avx2: $(PASST_SRCS) $(HEADERS)
|
$(CC) $(AVXFLAGS) $(FLAGS) $(CFLAGS) $(CPPFLAGS) -c $(@:.avx2.o=.c) -o $@
|
||||||
$(CC) $(filter-out -O2,$(FLAGS)) $(CFLAGS) $(CPPFLAGS) \
|
|
||||||
$(PASST_SRCS) -o passt.avx2 $(LDFLAGS)
|
|
||||||
|
|
||||||
passt.avx2: passt
|
passt: $(PASST_OBJS) seccomp.h
|
||||||
|
$(CC) $(FLAGS) $(CFLAGS) $(CPPFLAGS) $(PASST_OBJS) -o passt $(LDFLAGS)
|
||||||
|
|
||||||
|
passt.avx2: $(PASST_AVX2_OBJS) $(HEADERS) seccomp.h
|
||||||
|
$(CC) $(filter-out -O2,$(FLAGS)) $(CFLAGS) $(CPPFLAGS) $(AVXFLAGS) \
|
||||||
|
$(PASST_AVX2_OBJS) -o passt.avx2 $(LDFLAGS)
|
||||||
|
|
||||||
|
passt.avx2: passt seccomp.h
|
||||||
|
|
||||||
pasta.avx2 pasta.1 pasta: pasta%: passt%
|
pasta.avx2 pasta.1 pasta: pasta%: passt%
|
||||||
ln -sf $< $@
|
ln -sf $< $@
|
||||||
|
|
||||||
qrap: $(QRAP_SRCS) passt.h
|
qrap: $(QRAP_OBJS) passt.h seccomp.h
|
||||||
$(CC) $(FLAGS) $(CFLAGS) $(CPPFLAGS) $(QRAP_SRCS) -o qrap $(LDFLAGS)
|
$(CC) $(FLAGS) $(CFLAGS) $(CPPFLAGS) $(QRAP_OBJS) -o qrap $(LDFLAGS)
|
||||||
|
|
||||||
valgrind: EXTRA_SYSCALLS += rt_sigprocmask rt_sigtimedwait rt_sigaction \
|
valgrind: EXTRA_SYSCALLS += rt_sigprocmask rt_sigtimedwait rt_sigaction \
|
||||||
getpid gettid kill clock_gettime mmap \
|
getpid gettid kill clock_gettime mmap \
|
||||||
|
@ -170,21 +182,8 @@ pkgs: static
|
||||||
# other way around: the web version should be obtained by adding HTML and
|
# other way around: the web version should be obtained by adding HTML and
|
||||||
# JavaScript portions to a plain Markdown, instead. However, cgit needs to use
|
# JavaScript portions to a plain Markdown, instead. However, cgit needs to use
|
||||||
# a file in the git tree. Find a better way around this.
|
# a file in the git tree. Find a better way around this.
|
||||||
docs: README.md
|
docs:
|
||||||
@( \
|
[ ! -e doc/ ]; mkdir docs; perl makedocs.pl > docs/README.plain.md
|
||||||
skip=0; \
|
|
||||||
while read l; do \
|
|
||||||
case $$l in \
|
|
||||||
"## Demo") exit 0 ;; \
|
|
||||||
"<!"*) ;; \
|
|
||||||
"</"*) skip=1 ;; \
|
|
||||||
"<"*) skip=2 ;; \
|
|
||||||
esac; \
|
|
||||||
\
|
|
||||||
[ $$skip -eq 0 ] && echo "$$l"; \
|
|
||||||
[ $$skip -eq 1 ] && skip=0; \
|
|
||||||
done < README.md; \
|
|
||||||
) > README.plain.md
|
|
||||||
|
|
||||||
# Checkers currently disabled for clang-tidy:
|
# Checkers currently disabled for clang-tidy:
|
||||||
# - llvmlibc-restrict-system-libc-headers
|
# - llvmlibc-restrict-system-libc-headers
|
||||||
|
|
19
makedocs.pl
Normal file
19
makedocs.pl
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $str = '';
|
||||||
|
my $regex = qr/(<[^\/].*?>.*?<\/.*?>\n?)|(<\/div>)|(<\/p>)/msp;
|
||||||
|
my $subst = '';
|
||||||
|
|
||||||
|
|
||||||
|
local $/=undef;
|
||||||
|
open FILE, '<', 'README.md' or die "Can't open file $!";
|
||||||
|
my $file_content = <FILE>;
|
||||||
|
close FILE;
|
||||||
|
#print "Source: $file_content\n";
|
||||||
|
my $result = $file_content =~ s/$regex//rg;
|
||||||
|
|
||||||
|
my $regex2 = qr/\n[ \n]{3,}\n/msp;
|
||||||
|
$result = $result =~ s/$regex2/\n\n/rg;
|
||||||
|
|
||||||
|
#print "The result of the substitution is: $result\n";
|
||||||
|
print "$result\n";
|
Loading…
Reference in a new issue