makefile

来自「fsmlabs的real time linux的内核」· 代码 · 共 93 行

TXT
93
字号
SOURCE:=$(shell (ls *.c))MODULES=$(shell for i in `ls *.c | awk -F. '{print $$1}' `; do echo $$i".o" ; done )MODNAMES=$(shell for i in `ls *.c | awk -F. '{print $$1}' `; do echo $$i; done )include ../../../rtl.mkclean:	rm -f *.oifneq ($(ARCH),mips)LIBGCC := $(shell $(CC) -print-libgcc-file-name)elseLIBGCC          = libgcc.olibgcc.o: mips/libgcc2.c        $(CC) $(CFLAGS) -DCROSS_COMPILE -DIN_GCC -I./include -DIN_LIBGCC2 -D__GCendif accuracity.o: $(LIBGCC)	$(CC) ${INCLUDE} ${CFLAGS} -c accuracity.c -o accuracity_tmp.o	$(LD) $(LDFLAGS) -r -o accuracity.o accuracity_tmp.o ${LIBGCC}                 test.o: $(LIBGCC)	$(CC) ${INCLUDE} ${CFLAGS} -c test.c -o test_tmp.o	$(LD) $(LDFLAGS) -r -o test.o test_tmp.o ${LIBGCC}                      simple_test.o: $(LIBGCC)	$(CC) ${INCLUDE} ${CFLAGS} -c simple_test.c -o simple_test_tmp.o	$(LD) $(LDFLAGS) -r -o simple_test.o simple_test_tmp.o ${LIBGCC}                      signals_bandwidth.o: $(LIBGCC)	$(CC) ${INCLUDE} ${CFLAGS} -c signals_bandwidth.c -o signals_bandwidth_tmp.o	$(LD) $(LDFLAGS) -r -o signals_bandwidth.o signals_bandwidth_tmp.o ${LIBGCC}     all:$(MODULES)help:	@echo "/***************************************************************/"	@echo "/*  Self build RTLinux POSIX timers test                       */"	@echo "/***************************************************************/"	test: all help	@echo "First we remove any existing rtl-modules"	@echo "You may see error warnings from \"make\" - ignore them"	@echo "Type <return> to continue"	@read junk	-rmmod sound	-rmmod rt_process	-rmmod frank_module	-(for i in $(MODNAMES) ; do rmmod $$i ; done)	 		(cd ../../../; scripts/rmrtl)	@echo "Now insert the fifo and scheduler"	@echo "Type <return> to continue"	@read junk	(cd ../../../; scripts/insrtl)	@echo "Now start the real-time test tasks modules"	@echo "Type <return> to continue"	@read junk	@dmesg -c	(for i in $(MODNAMES) ; do \	echo ">------------------------------------------<" ; \	echo "          TESTING "$$i".o MODULE            " ; \	echo ">------------------------------------------<" ; \	cat $$i.c | awk '{ if ( NR > 10 && $$1 == "*" ) print $0 }' ; \	if [[ $$i == "test" ]]; then \	(rmmod rtl_sched ; cd ../../../monitor/ ; make ; insmod rtl_sched.o ); \	fi ; \	insmod $$i.o; \	if [[ $$i == "accuracity" ]]; then \	echo "Sleeping half a minit!" ; sleep 30; \	else \	echo "Sleeping for 4 seconds" ; sleep 4 ; \	fi ; \	echo ">------------------------------------------<" ; \	echo "               TEST RESULTS:                " ; \	echo ">------------------------------------------<" ; \	if [[ $$i == "test" ]]; then \	 (cd ../../../monitor; ./reader > /tmp/log.txt && \	awk '{if ($$1 == "TASK" || $$1 == ":BODY" || ($$3 >= 1000 && $$4 >= 1000)) \	print $$0'} /tmp/log.txt > /tmp/log_pp.txt && \	./crono /tmp/log_pp.txt&)\	; fi ;\	dmesg -c ;\	rmmod $$i ; \	echo "Type <return> to continue" ; \	read junk ; \	 done)include ../../../Rules.make

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?