xref: /DragonOS/Makefile (revision 0aec6827eeaeae11f349d83449293a7040543328)
1*0aec6827SfslongjinSUBDIRS = kernel user
2*0aec6827Sfslongjin
3*0aec6827Sfslongjin
4*0aec6827Sfslongjin
5*0aec6827Sfslongjin
6*0aec6827Sfslongjinexport ARCH=x86_64
7*0aec6827Sfslongjinexport ROOT_PATH=$(shell pwd)
8*0aec6827Sfslongjin
9*0aec6827Sfslongjinexport DEBUG=DEBUG
10*0aec6827Sfslongjinexport GLOBAL_CFLAGS := -mcmodel=large -fno-builtin -m64  -O0 -fno-stack-protector -D $(ARCH)
11*0aec6827Sfslongjin
12*0aec6827Sfslongjinifeq ($(DEBUG), DEBUG)
13*0aec6827SfslongjinGLOBAL_CFLAGS += -g
14*0aec6827Sfslongjinendif
15f479f321Sfslongjin
16f479f321Sfslongjin.PHONY: all
17f479f321Sfslongjinall:
180b0cce93Sfslongjin	mkdir -p bin/kernel/
19*0aec6827Sfslongjin	mkdir -p bin/user/
20f479f321Sfslongjin	@list='$(SUBDIRS)'; for subdir in $$list; do \
21f479f321Sfslongjin    		echo "make all in $$subdir";\
22f479f321Sfslongjin    		cd $$subdir;\
2305dc7ac7Sfslongjin    		 $(MAKE) all;\
24f479f321Sfslongjin    		cd ..;\
25f479f321Sfslongjin    done
26f479f321Sfslongjin
27f479f321Sfslongjin.PHONY: clean
28f479f321Sfslongjinclean:
29f479f321Sfslongjin	@list='$(SUBDIRS)'; for subdir in $$list; do \
30f479f321Sfslongjin		echo "Clean in dir: $$subdir";\
3105dc7ac7Sfslongjin		cd $$subdir && $(MAKE) clean;\
32f479f321Sfslongjin		cd .. ;\
33f479f321Sfslongjin	done
34e667fff2Sfslongjin
35e667fff2Sfslongjingdb:
36e667fff2Sfslongjin	gdb -n -x tools/.gdbinit