⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 一个小型的操作系统,采用gcc进行开发,几千行的代码,方便初学者学习
💻
字号:
####################################################################### Snixos Project version 1.0, 2003.6# (C) Copyright 2003,2004,2005 Jockeyson,KeqiangGao <Snallie@tom.com># All Rights Reserved.# Distributed under the terms of the GNU General Public License.## This program is a free and open source software and you can redistribute # it and/or modify it under the terms of the GNU General Public License as# published by the Free Software Foundation. As no any liability is assumed # for any incidental or consequential damages in connection with the # information or program fragments contained herein,so any exception arised# is at your own risk. It is ABSOLUTELY WITHOUT ANY WARRANTY.# Bug report please send to Snallie@tom.com .######################################################################## Makefile for snixos project#               jockeyson@tom.com#               snallie@tom.com   ,2003.05## prerequisite for the development : #		NASM version 0.98# 		gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)#               Linux 2.4.7-10 ## 0. to make snixos running in graphics mode: #	make clean; make all; make diskimg# 1. to make snixos running in text mode: #	make clean; make all VIDEO=TEXT; make diskimg# # when either of the above ones have beed done , you'll get floppy # disk image file named floppy.img, write it to a 1.44M floppy with 'dd'# in UNIX/Linux or 'rawrite' in Dos/Windows , then bootup with this # floppy to see what will happen. Also you can invoke 'make floppy'# in Linux to do this:#	make floppy #CC	= gccLD      = ldAS      = nasmINCLUDE = ./include LDFLAGS = -melf_i386 -Ttext 0x80000 -e kernelEntranceCCFLG   = -O2 -c -nostdinc -fno-builtin -I$(INCLUDE) -I. ASMOBJS = int.o shreg.o timer.o io.o speaker.o ASMFILES= $(ASMOBJS:%.o=%.asm) COBJS   = kernel.o vgatext.o ctype.o string.o mem.o fatfs.o \	  keyboard.o vgagraph.o myvm.o cmostime.o CFILES := $(COBJS:%.o=%.c)OBJS    = $(COBJS) $(ASMOBJS)  export VIDEO=GRAPHall: snixos.imgsnixos.img: boot.bin kernel.bin	@echo Create system image...	@cat ./boot/boot.bin kernel.bin >snixos.img	@echo System image created OK, try '"make floppy"' to make a Snixos boot disk.boot.bin: ./boot/boot.asm	@echo Making bootloader...	@$(MAKE) -C ./bootkernel.o: kernel.c 	@echo Making $<ifeq ($(VIDEO),GRAPH)	@$(CC) $(CCFLG) -DVIDEO_GRAPH_640X480  $< -o $@else	@$(CC) $(CCFLG) -DVIDEO_TEXT_80X25 $< -o $@endifkernel.bin: $(OBJS)	@echo Linking...	@$(LD) $(OBJS) $(LDFLAGS) -o $@.pre	@echo Dumping binnary ...	@objdump -sD $@.pre >$@.objdmp	@echo Making binnary executable ...	@objcopy -O binary -R .note -R .comment -S $@.pre $@%.o : %.c #vgatext.c ctype.c string.c fatfs.c clock.c keyboard.c vgagraph.c  myvm.c	@echo Making $<	@$(CC) $(CCFLG) $< -o $@mem.o: mem.c	@echo Making $<	@$(CC) $(CCFLG) -D_IN_SNIXOS  $< -o$@%.o : %.asm #int.asm shreg.asm timer.asm speaker.asm	@echo Making $<	@$(AS) -f elf $< -o $@# make a raw bootable floppy for the snixosfloppy: diskimgifeq ($(VIDEO),GRAPH)	dd if=./snixosCN.img of=/dev/fd0 bs=512 count=2880else	dd if=./snixosEN.img of=/dev/fd0 bs=512 count=2880endif	@echo "bootup with the floppy to see what will happen"diskimg: snixos.img	. ./mkflpimg.sh ifeq ($(VIDEO),GRAPH)	cp -f floppy.img snixosCN.imgelse	cp -f floppy.img snixosEN.imgendif	@echo Floppy disk image  snixosCN.img/snixosEN.img created OK. vmimg2:	diskimgifeq ($(VIDEO),GRAPH)	cp -f snixosCN.img /root/vmware/dos/Imageelse	cp -f snixosEN.img /root/vmware/dos/Imageendif	@echo "bootup in vmware to see what will happen"clean:	rm -f *.bin *.img *.o kernel.bin* *~ bochsout.txt \		kernel.bin.asm kernel.bin.map kernel.bin.objdmp kernel.bin.pre	$(MAKE) -C ./boot clean 	(cd include;rm -f *~;cd ..)# make a tarball named snixos_1.0_YYYYMMDD_HHMMSS.tgztarball: clean	(cd ..; tar czvf snixos_1.0_`date +%Y%m%d_%H%M%S`.tgz ./snixos; cd -)	@echo tarball snixos`date +%Y%m%d_%H%M%S`.tar.gz created OK!

⌨️ 快捷键说明

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