summaryrefslogblamecommitdiff
path: root/Makefile
blob: c5667d0cf2fa911fdb0436695a9527af0d350e7c (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                 
                                           
                          
 



                         

    

                                                         
                                         
                                                                                     




                     


                                                         
                                                                                   


            


                                                         
                                                                                      




                             
                       












                                        
                                       

                    
                                                                                    
 
.PHONY: clean, mrproper, Init.rfs, floppy, commit

Projects = common kernel user/lib user/test
QemuCmd = qemu-system-i386

BasePath = $(shell pwd)
SrcPath = $(BasePath)/src

Floppy = TCE.fl.img

all:
	@for p in $(Projects); do \
		echo ""; echo "----------------------"; \
		echo "=> Building $$p"; \
		BasePath=$(BasePath) SrcPath=$(SrcPath) make -C src/$$p || exit -1; \
	done

rebuild: mrproper all

clean:
	@for p in $(Projects); do \
		echo ""; echo "----------------------"; \
		echo "=> Cleaning $$p"; \
		BasePath=$(BasePath) SrcPath=$(SrcPath) make -C src/$$p clean -s; \
	done

mrproper:
	@for p in $(Projects); do \
		echo ""; echo "----------------------"; \
		echo "=> Cleaning $$p"; \
		BasePath=$(BasePath) SrcPath=$(SrcPath) make -C src/$$p mrproper -s; \
	done

commit: mrproper
	git add .
	git commit -a; exit 0
	git push origin

floppy:
	mkdir mnt; exit 0
	sudo mount $(Floppy) mnt -o loop
	sudo ./copy_fdd.sh
	sleep 0.3
	sudo umount mnt


bochs: all floppy
	bochs -f bochs.cfg

qemu: all floppy
	$(QemuCmd) -fda $(Floppy) -m 16

qemu-gdb: all floppy
	$(QemuCmd) -fda $(Floppy) -m 16 -s -S & gdb src/kernel/kernel.elf -x gdb-cmd