
git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@227 315a16e6-25f9-4109-90ae-ca3045a26c18
43 lines
1.4 KiB
Text
43 lines
1.4 KiB
Text
export TOPDIR = $(shell pwd)
|
|
export ARCH = x86
|
|
NAME = metalsvm.bin
|
|
SYM_NAME = metalsvm.sym
|
|
KERNDIRS = libkern kernel mm fs arch lwip drivers
|
|
SUBDIRS = libgloss $(KERNDIRS)
|
|
OBJS = $(shell for i in $(KERNDIRS); do find $$i -name *.o; done)
|
|
OBJCOPY = objcopy
|
|
STRIP_DEBUG = --strip-debug
|
|
KEEP_DEBUG = --only-keep-debug
|
|
|
|
export MAKE = make
|
|
export ASM = nasm
|
|
export ASMFLAGS = -felf32 -g
|
|
export INCLUDE = -I$(TOPDIR)/include -I$(TOPDIR)/arch/$(ARCH)/include -I$(TOPDIR)/lwip/src/include -I$(TOPDIR)/lwip/src/include/ipv4
|
|
export CC = gcc
|
|
export CFLAGS = -g -m32 -march=i386 -Wall -O2 -fno-zero-initialized-in-bss -fno-builtin-function -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc $(INCLUDE) -fno-stack-protector
|
|
export AR = ar
|
|
export ARFLAGS = rsv
|
|
export RM = rm -rf
|
|
LD = ld
|
|
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') --defsym __BUILD_VERSION=$(shell svnversion -cn ../ | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | grep "[0-9]")
|
|
|
|
default:
|
|
for i in $(SUBDIRS); do $(MAKE) -C $$i default; done
|
|
$(MAKE) link
|
|
|
|
all:
|
|
for i in $(SUBDIRS); do $(MAKE) -C $$i all; done
|
|
$(MAKE) link
|
|
|
|
link:
|
|
$(LD) $(LDFLAGS) -o $(NAME) $(OBJS)
|
|
$(OBJCOPY) $(KEEP_DEBUG) $(NAME) $(SYM_NAME)
|
|
$(OBJCOPY) $(STRIP_DEBUG) $(NAME)
|
|
|
|
clean:
|
|
$(RM) $(NAME) $(SYM_NAME) *~
|
|
for i in $(SUBDIRS); do $(MAKE) -k -C $$i clean; done
|
|
|
|
depend:
|
|
for i in $(SUBDIRS); do $(MAKE) -k -C $$i depend; done
|
|
|