From 575f2e424a17737111786227103a428fb5c20396 Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期一, 12 十月 2020 18:15:27 +0800
Subject: [PATCH] req_rep

---
 Make.defines.linux |   62 +++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/Make.defines.linux b/Make.defines.linux
index 8c48553..2a1fddc 100755
--- a/Make.defines.linux
+++ b/Make.defines.linux
@@ -1,20 +1,68 @@
 # Common make definitions, customized for each platform
 
+
+
+# Cross-compiler jos toolchain
+#
+# This Makefile will automatically use the cross-compiler toolchain
+# installed as 'i386-jos-elf-*', if one exists.  If the host tools ('gcc',
+# 'objdump', and so forth) compile for a 32-bit x86 ELF target, that will
+# be detected as well.  If you have the right compiler toolchain installed
+# using a different name, set GCCPREFIX explicitly in conf/env.mk
+
+# try to infer the correct GCCPREFIX
+ifndef GCCPREFIX
+GCCPREFIX := $(shell if i386-jos-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \
+	then echo 'i386-jos-elf-'; \
+	elif objdump -i 2>&1 | grep 'elf32-i386' >/dev/null 2>&1; \
+	then echo ''; \
+	else echo "***" 1>&2; \
+	echo "*** Error: Couldn't find an i386-*-elf version of GCC/binutils." 1>&2; \
+	echo "*** Is the directory with i386-jos-elf-gcc in your PATH?" 1>&2; \
+	echo "*** If your i386-*-elf toolchain is installed with a command" 1>&2; \
+	echo "*** prefix other than 'i386-jos-elf-', set your GCCPREFIX" 1>&2; \
+	echo "*** environment variable to that prefix and run 'make' again." 1>&2; \
+	echo "*** To turn off this error, run 'gmake GCCPREFIX= ...'." 1>&2; \
+	echo "***" 1>&2; exit 1; fi)
+endif
+
 # Definitions required in all program directories to compile and link
 # C programs using gcc.
-
+DEBUG=y
 CC = g++
-COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
-LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
-LDFLAGS=
+# COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
+# LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
+
+# preprocessor options 
+CPPFLAGS += $(INCLUDES) -std=c++11
+# compilation options
+CFLAGS += $(DEBUGFLAGS) -Wall -DLINUX -D_GNU_SOURCE $(EXTRA)
+# linked options
+LDFLAGS +=
 
 
-CFLAGS = $(INCLUDE) -g -std=c++11 -mcx16 -Wall  -DLINUX -D_GNU_SOURCE $(EXTRA)
+LDDIR += -L$(ROOT)/lib
+LDLIBS += $(RPATH) $(LDDIR) $(EXTRALIBS)
+
+INCLUDES += -I. -I./include -I$(ROOT)/include
+
+DEST=$(ROOT)/build
+# DEST=.
+
+ifeq ($(DEBUG),y)
+  DEBUGFLAGS = -O -g # "-O" is needed to expand inlines
+else
+  DEBUGFLAGS = -O2
+endif
+
+
+
 RANLIB=echo
 AR=ar
 AWK=awk
-
+NM	:= $(GCCPREFIX)nm
 
 # Common temp files to delete from each directory.
-TEMPFILES=core core.* *.o temp.* *.out *.a *.so
+TEMPFILES=core core.* *.o temp.* *.out *.a *.so *.sym
+
 

--
Gitblit v1.8.0