mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 14:16:47 +00:00
51 lines
843 B
Makefile
51 lines
843 B
Makefile
SUBDIRS = kernel user
|
|
|
|
|
|
|
|
|
|
export ARCH=__x86_64__
|
|
export ROOT_PATH=$(shell pwd)
|
|
|
|
export DEBUG=DEBUG
|
|
export GLOBAL_CFLAGS := -mcmodel=large -fno-builtin -m64 -fno-stack-protector -D $(ARCH) -O0
|
|
|
|
ifeq ($(DEBUG), DEBUG)
|
|
GLOBAL_CFLAGS += -g
|
|
endif
|
|
|
|
.PHONY: all
|
|
all: kernel user
|
|
|
|
|
|
|
|
.PHONY: kernel
|
|
kernel:
|
|
mkdir -p bin/kernel/
|
|
@list='./kernel'; for subdir in $$list; do \
|
|
echo "make all in $$subdir";\
|
|
cd $$subdir;\
|
|
$(MAKE) all;\
|
|
cd ..;\
|
|
done
|
|
|
|
.PHONY: user
|
|
user:
|
|
mkdir -p bin/user/
|
|
mkdir -p bin/tmp/
|
|
@list='./user'; for subdir in $$list; do \
|
|
echo "make all in $$subdir";\
|
|
cd $$subdir;\
|
|
$(MAKE) all;\
|
|
cd ..;\
|
|
done
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
@list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
echo "Clean in dir: $$subdir";\
|
|
cd $$subdir && $(MAKE) clean;\
|
|
cd .. ;\
|
|
done
|
|
|
|
gdb:
|
|
gdb -n -x tools/.gdbinit
|