From 0dbf546b3820fe446420da5392f89d034bf7c860 Mon Sep 17 00:00:00 2001 From: Tee-Kiah Chia Date: Sun, 3 Mar 2019 11:24:15 +0800 Subject: [PATCH] Some tweaks to get it to build under Ubuntu Xenial (16.04) --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f025aee..cc889c0 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ DESTDIR ?= /usr/local CORES ?= 1 # Basic feature detection -OS = $(shell cat /etc/os-release | grep "rhel\|fedora\|centos" && echo "rhel" || cat /etc/os-release | grep "debian\|ubuntu" && echo "debian" || uname) +OS = $(shell cat /etc/os-release | grep -q "rhel\|fedora\|centos" && echo "rhel" || cat /etc/os-release | grep -q "debian\|ubuntu" && echo "debian" || uname) ARCH ?= $(shell uname -m) ifeq ($(ARCH), i686) @@ -113,12 +113,13 @@ t/%.exe: t/%.o $(LIB) Makefile all: $(LIB) $(SYSINC): /usr/include/$(UNISTD_PATH)/asm/unistd_$(MSIZE).h - echo -e "\n#define __SYSCALL(x,y)\n" >> $@ + echo "#define __SYSCALL(x,y)" > $@ grep __NR_ $< | sed -e s/__NR_/SYS_/g >> $@ + echo >> $@ ifeq ($(WITH_FAST_SYSCALL), 1) - echo -e "\n#define __RT0_WITH_FASTER_SYSCALL__ 1\n" >> $@ + echo "#define __RT0_WITH_FASTER_SYSCALL__ 1" >> $@ endif - echo -e "\n#undef __SYSCALL\n" >> $@ + echo "#undef __SYSCALL" >> $@ $(LIB): $(LOBJ) $(AR) -rcs $@ $^