Introduce CPP_FOR_TARGET in Makefile
This commit is contained in:
parent
5b5139c283
commit
f58afd7e34
1 changed files with 25 additions and 24 deletions
|
@ -1,4 +1,4 @@
|
|||
TOPDIR = $(shell pwd)
|
||||
TOPDIR := $(shell pwd)
|
||||
ARCH = x86
|
||||
NAME = metalsvm
|
||||
LWIPDIRS = lwip/src/arch lwip/src/api lwip/src/core lwip/src/core/ipv4 lwip/src/netif
|
||||
|
@ -17,6 +17,7 @@ CROSSCOMPREFIX=
|
|||
CC_FOR_TARGET = $(CROSSCOMPREFIX)gcc
|
||||
CXX_FOR_TARGET = $(CROSSCOMPREFIX)g++
|
||||
GCC_FOR_TARGET = $(CROSSCOMPREFIX)gcc
|
||||
CPP_FOR_TARGET = $(CROSSCOMPREFIX)cpp
|
||||
AR_FOR_TARGET = $(CROSSCOMPREFIX)ar
|
||||
AS_FOR_TARGET = $(CROSSCOMPREFIX)as
|
||||
LD_FOR_TARGET = $(CROSSCOMPREFIX)ld
|
||||
|
@ -27,19 +28,19 @@ RANLIB_FOR_TARGET=$(CROSSCOMPREFIX)ranlib
|
|||
STRIP_FOR_TARGET = $(CROSSCOMPREFIX)strip
|
||||
READELF_FOR_TARGET = $(CROSSCOMPREFIX)readelf
|
||||
|
||||
MAKE = make
|
||||
RM = rm -rf
|
||||
NASM = nasm
|
||||
EMU = qemu
|
||||
GDB = gdb
|
||||
|
||||
MAKE = make
|
||||
NASMFLAGS = -felf32 -g
|
||||
INCLUDE = -I$(TOPDIR)/include -I$(TOPDIR)/arch/$(ARCH)/include -I$(TOPDIR)/lwip/src/include -I$(TOPDIR)/lwip/src/include/ipv4 -I$(TOPDIR)/drivers
|
||||
# Compiler options for final code
|
||||
CFLAGS = -g -m32 -march=i586 -Wall -O2 -fno-builtin -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc $(INCLUDE) $(STACKPROT)
|
||||
# Compiler options for debuuging
|
||||
# Compiler options for debugging
|
||||
#CFLAGS = -g -O -m32 -march=i586 -Wall -fno-builtin -DWITH_FRAME_POINTER -nostdinc $(INCLUDE) $(STACKPROT)
|
||||
ARFLAGS = rsv
|
||||
RM = rm -rf
|
||||
LDFLAGS = -T link.ld -z max-page-size=4096 --defsym __BUILD_DATE=$(shell date +'%Y%m%d') --defsym __BUILD_TIME=$(shell date +'%H%M%S')
|
||||
STRIP_DEBUG = --strip-debug
|
||||
KEEP_DEBUG = --only-keep-debug
|
||||
|
@ -104,7 +105,7 @@ veryclean: clean
|
|||
@echo [CC] $@
|
||||
$Q$(CC_FOR_TARGET) -c -D__KERNEL__ $(CFLAGS) -o $@ $<
|
||||
@echo [DEP] $*.dep
|
||||
$Q$(CC_FOR_TARGET) -MF $*.dep -MT $*.o -MM $(CFLAGS) $<
|
||||
$Q$(CPP_FOR_TARGET) -MF $*.dep -MT $*.o -MM $(CFLAGS) $<
|
||||
|
||||
|
||||
%.o : %.asm
|
||||
|
|
Loading…
Add table
Reference in a new issue