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 |   75 +++++++++++++++++++++++++++----------
 1 files changed, 55 insertions(+), 20 deletions(-)

diff --git a/Make.defines.linux b/Make.defines.linux
index 5be4d47..2a1fddc 100755
--- a/Make.defines.linux
+++ b/Make.defines.linux
@@ -1,33 +1,68 @@
 # Common make definitions, customized for each platform
 
-# Definitions required in all program directories to compile and link
-# C programs using gcc.
 
-CC = g++
-COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
-LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
-LDFLAGS=
-LDDIR += -L$(ROOT)/lib
-LDLIBS += $(LDDIR) -lusgcommon $(EXTRALIBS)
-INCLUDE += -I. -I./include -I$(ROOT)/include -I$(ROOT)/include/usgcommon
 
-ifeq ($(DEBUG),y)
-  DEBFLAGS = -O -g # "-O" is needed to expand inlines
-else
-  DEBFLAGS = -O2
+# 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
 
-CFLAGS += $(INCLUDE)  $(DEBFLAGS) -mcx16 -std=c++11 -Wall -DLINUX -D_GNU_SOURCE $(EXTRA)
+# Definitions required in all program directories to compile and link
+# C programs using gcc.
+DEBUG=y
+CC = g++
+# 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 +=
+
+
+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
-LIBCOMMON=$(ROOT)/common/libusgcommon.a
-
+NM	:= $(GCCPREFIX)nm
 
 # Common temp files to delete from each directory.
-TEMPFILES=core core.* *.o temp.* *.out *.a *.so
-
-%:	%.c $(LIBCOMMON)
-	$(CC) $(CFLAGS) $(filter-out $(LIBCOMMON), $^) -o $@ $(LDFLAGS) $(LDLIBS)
+TEMPFILES=core core.* *.o temp.* *.out *.a *.so *.sym
 
 

--
Gitblit v1.8.0