MAJORVER = 0 # 1 before my life is over, I hope :) MINORVER = 0 SUBLEVEL = 0 PATCHLEV = 0 # linuxMT root directory # and backup directory # MT_DIR = $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) BACKUP_DIR = /usr/local/src/elk # # if you want the ram-disk device, define this to be the # size in blocks. # RAMDISK = -DRAMDISK=512 AS86 =as86 -0 LD86 =ld86 -0 AS =as LD =ld86 LDFLAGS =-0 -i CC =bcc $(RAMDISK) CFLAGS =-D__KERNEL__ -i CPP =$(CC) -I$(MT_DIR)/include -E -D__KERNEL__ CC_PROTO = gcc -I$(MT_DIR)/include -M -D__KERNEL__ # # ROOT_DEV specifies the default root-device when making the image. # This can be either FLOPPY, /dev/xxxx or empty, in which case the # default of /dev/hd6 is used by 'build'. # ROOT_DEV=/dev/hda1 SWAP_DEV=/dev/hd2 #ARCHIVES=kernel/kernel.o mm/mm.o fs/fs.o ARCHIVES=kernel/kernel.a fs/fs.a fs/minix/minixfs.a lib/lib.a mm/mm.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a DRIVERS =drivers/char/chr_drv.a drivers/block/blk_drv.a ######################################################################### # general construction rules .c.s: $(CC) $(CFLAGS) \ -0 -nostdinc -Iinclude -S -o $*.s $< .s.o: $(AS) -0 -I$(MT_DIR)/include -c -o $*.o $< .S.s: gcc -E -traditional -o $*.s $< .c.o: $(CC) $(CFLAGS) \ -0 -nostdinc -Iinclude -c -o $*.o $< ######################################################################### # targets all: Image Image: arch/i86/boot/bootsect arch/i86/boot/setup arch/i86/tools/system arch/i86/tools/build arch/i86/tools/build arch/i86/boot/bootsect arch/i86/boot/setup arch/i86/tools/system $(ROOT_DEV) > Image sync disk: Image dd bs=8192 if=Image of=/dev/PS0 ######################################################################### # library rules .PHONY: arch/i86/kernel/akernel.a \ arch/i86/lib/lib86.a arch/i86/mm/mm.a \ drivers/char/chr_drv.a drivers/block/blk_drv.a \ fs/fs.a fs/minix/minixfs.a \ kernel/kernel.a lib/lib.a mm/mm.a arch/i86/kernel/akernel.a: (cd arch/i86/kernel; make) arch/i86/lib/lib86.a: (cd arch/i86/lib; make) arch/i86/mm/mm.a: (cd arch/i86/mm; make) drivers/char/chr_drv.a: (cd drivers/char; make) drivers/block/blk_drv.a: (cd drivers/block; make) fs/fs.a: (cd fs; make) fs/minix/minixfs.a: (cd fs/minix; make) kernel/kernel.a: (cd kernel; make) lib/lib.a: (cd lib; make) mm/mm.a: (cd mm; make) ######################################################################### # arch tools arch/i86/boot/setup: arch/i86/boot/setup.S gcc -E -traditional -I$(MT_DIR)/include/ -o arch/i86/boot/setup.s arch/i86/boot/setup.S $(AS86) -o arch/i86/boot/setup.o arch/i86/boot/setup.s $(LD86) -s -o arch/i86/boot/setup arch/i86/boot/setup.o arch/i86/boot/bootsect: arch/i86/boot/bootsect.S gcc -E -traditional -I$(MT_DIR)/include/ -o arch/i86/boot/bootsect.s arch/i86/boot/bootsect.S $(AS86) -0 -o arch/i86/boot/bootsect.o arch/i86/boot/bootsect.s $(LD86) -0 -s -o arch/i86/boot/bootsect arch/i86/boot/bootsect.o arch/i86/boot/crt1.o: arch/i86/boot/crt1.c arch/i86/boot/crt0.o: arch/i86/boot/crt0.s $(AS86) -0 -o arch/i86/boot/crt0.o arch/i86/boot/crt0.s arch/i86/tools/build: arch/i86/tools/build.c gcc -o arch/i86/tools/build arch/i86/tools/build.c arch/i86/tools/system: arch/i86/boot/crt0.o arch/i86/boot/crt1.o init/main.o \ $(ARCHIVES) $(DRIVERS) $(MATH) $(LIBS) $(LD) $(LDFLAGS) arch/i86/boot/crt0.o arch/i86/boot/crt1.o init/main.o \ $(ARCHIVES) \ $(DRIVERS) \ $(MATH) \ $(LIBS) \ -t -o arch/i86/tools/system #> System.map ######################################################################### # misc clean: rm -f *~ Image System.map tmp_make core rm -f arch/i86/boot/bootsect arch/i86/boot/setup \ arch/i86/boot/bootsect.s arch/i86/boot/setup.s rm -f arch/i86/boot/*~ arch/i86/boot/*.o rm -f arch/i86/tools/system arch/i86/tools/build rm -f arch/i86/tools/*~ arch/i86/tools/*.o rm -f init/*~ init/*.o (cd arch/i86/kernel; make clean) (cd arch/i86/lib; make clean) (cd arch/i86/mm; make clean) (cd drivers/block; make clean) (cd drivers/char; make clean) (cd fs;make clean) (cd fs/minix;make clean) (cd kernel;make clean) (cd lib;make clean) (cd mm;make clean) backup: clean (cd .. ; tar cf - linuxmt | compress - > $(BACKUP_DIR)/linuxMT.tar.Z) sync dep: sed '/\#\#\# Dependencies/q' < Makefile > tmp_make (for i in init/*.c;do echo -n "init/";$(CC_PROTO) $$i;done) >> tmp_make mv tmp_make Makefile (cd arch/i86/kernel; make dep) (cd arch/i86/lib; make dep) (cd arch/i86/mm; make dep) (cd drivers/block; make dep) (cd drivers/char; make dep) (cd fs; make dep) (cd fs/minix; make dep) (cd kernel; make dep) (cd lib; make dep) (cd mm; make dep) ### Dependencies: init/main.o: init/main.c \ /home/anarchy/ELKS/linuxmt/include/linuxmt/config.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/autoconf.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/types.h \ /home/anarchy/ELKS/linuxmt/include/arch/types.h \ /home/anarchy/ELKS/linuxmt/include/arch/system.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/sched.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/fs.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/wait.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/vfs.h \ /home/anarchy/ELKS/linuxmt/include/arch/statfs.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/kdev_t.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/ioctl.h \ /home/anarchy/ELKS/linuxmt/include/arch/ioctl.h \ /home/anarchy/ELKS/linuxmt/include/arch/bitops.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/pipe_fs_i.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/minix_fs_i.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/minix_fs_sb.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/time.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/signal.h \ /home/anarchy/ELKS/linuxmt/include/linuxmt/timex.h