Changeset 160 for soft/giet_vm/Makefile
- Timestamp:
- Jun 12, 2012, 4:21:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r158 r160 4 4 DU=mipsel-unknown-elf-objdump 5 5 6 SYS_OBJS = reset.o \7 boot_handler.o \8 giet.o \9 switch.o \10 common.o \11 ctx_handler.o \12 drivers.o \13 exc_handler.o \14 irq_handler.o\15 sys_handler.o6 SYS_OBJS = giet.o \ 7 switch.o \ 8 common.o \ 9 ctx_handler.o \ 10 drivers.o \ 11 exc_handler.o \ 12 irq_handler.o \ 13 sys_handler.o \ 14 init.o \ 15 task_init.o 16 16 17 PGCD_OBJS = pgcd_stdio.o \ 18 pgcd_main.o 19 20 HELLO_OBJS = hello_stdio.o \ 21 hello_main.o 22 23 FIFO_OBJS = fifo_stdio.o \ 24 fifo_main.o \ 25 fifo_mwmr.o 26 27 ROUTER_OBJS = router_stdio.o \ 28 router_main.o \ 29 router_mwmr.o 17 BOOT_OBJS = reset.o \ 18 boot_handler.o 30 19 31 20 SYS_PATH = sys 32 HELLO_PATH = hello 33 FIFO_PATH = fifo 34 PGCD_PATH = pgcd 35 ROUTER_PATH = router 21 BOOT_PATH = boot 36 22 MAP_PATH = xml 37 23 LIBS_PATH = libs 24 BUILD_DIR_NAME = build 38 25 39 CFLAGS=-Wall -ffreestanding -mno-gpopt -mips32 26 CFLAGS=-Wall -ffreestanding -mno-gpopt -mips32 -g 40 27 41 28 SYS_INCLUDE = -I$(SYS_PATH) -I$(MAP_PATH) -I$(LIBS_PATH) -I. 42 HELLO_INCLUDE= -I$(HELLO_PATH) -I$(LIBS_PATH)43 FIFO_INCLUDE= -I$(FIFO_PATH) -I$(LIBS_PATH)44 PGCD_INCLUDE= -I$(PGCD_PATH) -I$(LIBS_PATH)45 ROUTER_INCLUDE= -I$(ROUTER_PATH) -I$(LIBS_PATH)46 29 47 all: sys.bin hello.bin router.bin fifo.bin pgcd.bin map.bin 30 BOOT_INCLUDE = -I$(BOOT_PATH) -I$(MAP_PATH) -I$(LIBS_PATH) -I. 31 32 #commons between sys and boot are: common.ld , mips_registers.h... 33 34 TRASH= /dev/null||true 35 36 .PHONY: apps prepare 37 38 all: prepare soft.bin 39 40 41 ## merge all *.bin to soft.bin 42 soft.bin: boot.bin sys.bin map.bin apps 43 make -C mover 44 mover/mover.x -sm map.bin 45 $(DU) -D $@ > $@.txt 46 47 ## prepare the environement 48 prepare: 49 @mkdir $(BUILD_DIR_NAME) 2>$(TRASH) 48 50 49 51 ## mapping compilation 50 51 52 map.bin: map.xml 53 make -C xml #compile the parser 52 54 xml/xml2bin map.xml map.bin 53 55 54 56 ## system compilation 55 56 57 sys.bin: $(SYS_OBJS) $(SYS_PATH)/sys.ld 57 $(LD) -o $@ -T $(SYS_PATH)/sys.ld $(SYS_OBJS)58 $(DU) -D $@ > $@.txt58 (cd $(BUILD_DIR_NAME); $(LD) -o ../$@ -T ../$(SYS_PATH)/sys.ld $(SYS_OBJS) ) 59 (cd $(BUILD_DIR_NAME); $(DU) -D ../$@ > $@.txt) 59 60 60 61 switch.o: $(SYS_PATH)/switch.s giet_config.h 61 $(AS) -g -mips32 -o $ @ $<62 $(AS) -g -mips32 -o $(BUILD_DIR_NAME)/$@ $< 62 63 63 64 giet.o: $(SYS_PATH)/giet.s giet_config.h 64 $(AS) -g -mips32 -o $ @ $<65 $(AS) -g -mips32 -o $(BUILD_DIR_NAME)/$@ $< 65 66 66 reset.o: $(SYS_PATH)/reset.S giet_config.h 67 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $@ $< 68 $(DU) -D $@ > $@.txt 69 70 boot_handler.o: $(SYS_PATH)/boot_handler.c $(SYS_PATH)/boot_handler.h giet_config.h 71 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $@ $< 67 task_init.o: $(SYS_PATH)/task_init.S giet_config.h 68 #$(AS) -g -mips32 -o $(BUILD_DIR_NAME)/$@ $< 69 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 70 $(DU) -D $(BUILD_DIR_NAME)/$@ > $(BUILD_DIR_NAME)/$@.txt 72 71 73 72 ctx_handler.o: $(SYS_PATH)/ctx_handler.c $(SYS_PATH)/ctx_handler.h giet_config.h 74 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $ @ $<73 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 75 74 76 75 exc_handler.o: $(SYS_PATH)/exc_handler.c $(SYS_PATH)/exc_handler.h giet_config.h 77 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $ @ $<76 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 78 77 79 78 irq_handler.o: $(SYS_PATH)/irq_handler.c $(SYS_PATH)/irq_handler.h giet_config.h 80 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $ @ $<79 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 81 80 82 81 sys_handler.o: $(SYS_PATH)/sys_handler.c $(SYS_PATH)/sys_handler.h giet_config.h 83 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $ @ $<82 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 84 83 85 84 drivers.o: $(SYS_PATH)/drivers.c $(SYS_PATH)/drivers.h giet_config.h 86 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $ @ $<85 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 87 86 88 87 common.o: $(SYS_PATH)/common.c $(SYS_PATH)/common.h giet_config.h 89 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $ @ $<88 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 90 89 91 ## application "hello" compilation 90 init.o: $(SYS_PATH)/init.c giet_config.h 91 $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 92 92 93 hello.bin: $(HELLO_OBJS) $(HELLO_PATH)/hello.ld 94 $(LD) -o $@ -T $(HELLO_PATH)/hello.ld $(HELLO_OBJS) 95 $(DU) -D $@ > $@.txt 93 ## boot compilation 94 boot.bin: $(BOOT_OBJS) $(BOOT_PATH)/boot.ld 95 (cd $(BUILD_DIR_NAME); $(LD) -o ../$@ -T ../$(BOOT_PATH)/boot.ld $(BOOT_OBJS) ) 96 (cd $(BUILD_DIR_NAME); $(DU) -D ../$@ > $@.txt) 96 97 97 hello_stdio.o: $(LIBS_PATH)/stdio.c $(LIBS_PATH)/stdio.h giet_config.h 98 $(CC) $(CFLAGS) $(HELLO_INCLUDE) -c -o $@ $< 98 reset.o: $(BOOT_PATH)/reset.S giet_config.h 99 $(CC) $(CFLAGS) $(BOOT_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 100 $(DU) -D $(BUILD_DIR_NAME)/$@ > $(BUILD_DIR_NAME)/$@.txt 99 101 100 hello_main.o: $(HELLO_PATH)/main.cgiet_config.h101 $(CC) $(CFLAGS) $( HELLO_INCLUDE) -c -o$@ $<102 boot_handler.o: $(BOOT_PATH)/boot_handler.c $(BOOT_PATH)/boot_handler.h giet_config.h 103 $(CC) $(CFLAGS) $(BOOT_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $< 102 104 103 ## application "fifo" compilation 104 105 fifo.bin: $(FIFO_OBJS) $(FIFO_PATH)/fifo.ld 106 $(LD) -o $@ -T $(FIFO_PATH)/fifo.ld $(FIFO_OBJS) 107 $(DU) -D $@ > $@.txt 108 109 fifo_stdio.o: $(LIBS_PATH)/stdio.c $(LIBS_PATH)/stdio.h giet_config.h 110 $(CC) $(CFLAGS) $(FIFO_INCLUDE) -c -o $@ $< 111 112 fifo_mwmr.o: $(LIBS_PATH)/mwmr.c $(LIBS_PATH)/mwmr.h giet_config.h 113 $(CC) $(CFLAGS) $(FIFO_INCLUDE) -c -o $@ $< 114 115 fifo_main.o: $(FIFO_PATH)/main.c giet_config.h 116 $(CC) $(CFLAGS) $(FIFO_INCLUDE) -c -o $@ $< 117 118 ## application "router" compilation 119 120 router.bin: $(ROUTER_OBJS) $(ROUTER_PATH)/router.ld 121 $(LD) -o $@ -T $(ROUTER_PATH)/router.ld $(ROUTER_OBJS) 122 $(DU) -D $@ > $@.txt 123 124 router_stdio.o: $(LIBS_PATH)/stdio.c $(LIBS_PATH)/stdio.h giet_config.h 125 $(CC) $(CFLAGS) $(ROUTER_INCLUDE) -c -o $@ $< 126 127 router_mwmr.o: $(LIBS_PATH)/mwmr.c $(LIBS_PATH)/mwmr.h giet_config.h 128 $(CC) $(CFLAGS) $(ROUTER_INCLUDE) -c -o $@ $< 129 130 router_main.o: $(ROUTER_PATH)/main.c giet_config.h 131 $(CC) $(CFLAGS) $(ROUTER_INCLUDE) -c -o $@ $< 132 133 ## application "pgcd" compilation 134 135 pgcd.bin: $(PGCD_OBJS) $(PGCD_PATH)/pgcd.ld 136 $(LD) -o $@ -T $(PGCD_PATH)/pgcd.ld $(PGCD_OBJS) 137 $(DU) -D $@ > $@.txt 138 139 pgcd_stdio.o: $(LIBS_PATH)/stdio.c $(LIBS_PATH)/stdio.h giet_config.h 140 $(CC) $(CFLAGS) $(PGCD_INCLUDE) -c -o $@ $< 141 142 pgcd_main.o: $(PGCD_PATH)/main.c giet_config.h 143 $(CC) $(CFLAGS) $(PGCD_INCLUDE) -c -o $@ $< 105 ## applications and libs compilation 106 apps: 107 @echo "---------------------------------------------BUILDING APPS------------------------------------------------------" 108 make -C apps 144 109 145 110 ### special rules 146 147 111 clean: 148 rm -f *.o *.bin *.txt core *~ 112 rm -f *.o *.bin *.txt core *~ 2>$(TRASH) 113 make clean -C xml/ 2>$(TRASH) 114 make clean -C mover/ 2>$(TRASH) 115 make clean -C apps 2>$(TRASH) 116 rm -r $(BUILD_DIR_NAME) 2>$(TRASH)
Note: See TracChangeset
for help on using the changeset viewer.