xref: /DragonOS/Makefile (revision edb21695aec18626873f16d097e9772bec477942)
10aec6827SfslongjinSUBDIRS = kernel user
20aec6827Sfslongjin
30aec6827Sfslongjin
40aec6827Sfslongjin
50aec6827Sfslongjin
6*edb21695Sfslongjinexport ARCH=__x86_64__
70aec6827Sfslongjinexport ROOT_PATH=$(shell pwd)
80aec6827Sfslongjin
90aec6827Sfslongjinexport DEBUG=DEBUG
100aec6827Sfslongjinexport GLOBAL_CFLAGS := -mcmodel=large -fno-builtin -m64  -O0 -fno-stack-protector -D $(ARCH)
110aec6827Sfslongjin
120aec6827Sfslongjinifeq ($(DEBUG), DEBUG)
130aec6827SfslongjinGLOBAL_CFLAGS += -g
140aec6827Sfslongjinendif
15f479f321Sfslongjin
16f479f321Sfslongjin.PHONY: all
17f479f321Sfslongjinall:
180b0cce93Sfslongjin	mkdir -p bin/kernel/
190aec6827Sfslongjin	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