OpenBSD has no uuid, bring it with us
This commit is contained in:
parent
b16dcbdc02
commit
2b2ca1baf5
27
Makefile
27
Makefile
@ -17,12 +17,18 @@
|
||||
.SILENT:
|
||||
|
||||
ifeq ($(shell uname),OpenBSD)
|
||||
GCC:= egcc
|
||||
GCC:= egcc
|
||||
DEPS:= $(GCC) clang ./uuid
|
||||
ifndef MKUUID
|
||||
MKUUID!= $(shell $(MAKE) uuid)
|
||||
endif
|
||||
else
|
||||
GCC:= gcc
|
||||
GCC:= gcc
|
||||
DEPS:= $(GCC) clang uuid lld
|
||||
LDFLAGS+= -fuse-ld=lld
|
||||
endif
|
||||
|
||||
EXECUTABLES= clang $(GCC) uuid lld
|
||||
EXECUTABLES= $(DEPS)
|
||||
XXXX:= $(foreach exec,$(EXECUTABLES), $(if $(shell which $(exec) 2> /dev/null),X,$(error "No '$(exec)' in PATH, please install it and restart octopus !")))
|
||||
|
||||
### Generic flags
|
||||
@ -33,13 +39,12 @@ CFLAGS+= -Wall
|
||||
CFLAGS+= -Werror -Wextra
|
||||
CFLAGS+= -Wno-unused-parameter
|
||||
CFLAGS+= -Wno-missing-field-initializers
|
||||
LDFLAGS= -fuse-ld=lld
|
||||
|
||||
### Octopus flags
|
||||
CCS= clang $(GCC)
|
||||
OPTIMIZATIONS= 0 1 2 3 fast s
|
||||
RETPOLINE= mretpoline
|
||||
UUID:= $(shell uuid || uuidgen)
|
||||
UUID:= $(shell uuid || uuidgen || ./uuid)
|
||||
RESULTS_FILE:= results-$(UUID).json
|
||||
SSH_KEY= octoupload
|
||||
TIMES= 3
|
||||
@ -47,18 +52,21 @@ OCTOFLAGS= -j
|
||||
|
||||
### Octopus internals
|
||||
CPU:= $(shell LC_ALL=en_US.UTF-8 lscpu | grep "Model name" | cut -d":" -f 2 | sort | uniq | awk '{$$1=$$1;print}')
|
||||
UCODE:= $(shell grep microcode /proc/cpuinfo | sort | uniq | awk '{print $$NF}' || printf none)
|
||||
UCODE:= $(shell (grep microcode /proc/cpuinfo || printf unknown) | sort | uniq | awk '{print $$NF}' || printf unknown)
|
||||
KERN:= $(shell uname -svm)
|
||||
CLANGV:= $(shell clang -v 2>&1 | head -n 1)
|
||||
GCCV:= $(shell gcc -v 2>&1 | grep 'gcc version')
|
||||
VULN1:= $(shell cat /sys/devices/system/cpu/vulnerabilities/spectre_v1)
|
||||
VULN2:= $(shell cat /sys/devices/system/cpu/vulnerabilities/spectre_v2)
|
||||
VULN1:= $(shell (cat /sys/devices/system/cpu/vulnerabilities/spectre_v1 || printf unknown))
|
||||
VULN2:= $(shell (cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 || printf unknown))
|
||||
|
||||
|
||||
ifneq ($(shell uname),OpenBSD)
|
||||
ifndef PROGRESS
|
||||
HIT_TOTAL!= $(MAKE) $(MAKECMDGOALS) --dry-run PROGRESS="HIT_MARK" | grep -c "HIT_MARK"
|
||||
HIT_COUNT= $(eval HIT_N != expr $(HIT_N) + 1)$(HIT_N)
|
||||
PROGRESS= echo "[`expr $(HIT_COUNT) '*' 100 / $(HIT_TOTAL)`%]"
|
||||
endif
|
||||
endif
|
||||
|
||||
SUB_ONE= $(word 1, $(subst -, ,$@))
|
||||
SUB_TWO= $(word 2, $(subst -, ,$@))
|
||||
@ -212,5 +220,8 @@ $(RSGPROGS):
|
||||
@$(PROGRESS) $(SUB_TWO) $(addprefix -, $(SUB_FOUR)) $(CFLAGS) -mfunction-return=thunk -mindirect-branch=thunk -mindirect-branch-register -$(SUB_THREE) -o $@ $(SUB_ONE).c
|
||||
$(SUB_TWO) $(addprefix -, $(SUB_FOUR)) $(CFLAGS) -mfunction-return=thunk -mindirect-branch=thunk -mindirect-branch-register -$(SUB_THREE) -o $@ $(SUB_ONE).c
|
||||
|
||||
uuid:
|
||||
$(CC) -o $@ uuid.c
|
||||
|
||||
clean:
|
||||
rm -rf $(PROGS) *.json
|
||||
|
Loading…
Reference in New Issue
Block a user