Changeset 258 for soft/giet_vm/Makefile
- Timestamp:
- Dec 4, 2013, 7:48:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r256 r258 5 5 DU = mipsel-unknown-elf-objdump 6 6 7 MAP_XML = mappings/4c_1p_iob.xml 8 9 SYS_OBJS = build/sys/vm_handler.o \ 10 build/sys/sys_handler.o \ 11 build/sys/giet.o \ 12 build/sys/switch.o \ 13 build/sys/common.o \ 14 build/sys/ctx_handler.o \ 15 build/sys/drivers.o \ 16 build/sys/exc_handler.o \ 17 build/sys/irq_handler.o \ 18 build/sys/kernel_init.o 19 20 BOOT_OBJS = build/boot/reset.o \ 21 build/boot/boot_init.o 22 7 ### FAT parameters definition for Disk image 8 ### sector_size = 512 9 ### partition_begin_lba = 300 10 ### sector_per_cluster = 8 11 ### partition sectors = 524832 12 13 MAP_XML = mappings/4c_1p_iob_four.xml 14 15 ### Objects to be linked for kernel.elf 16 KERNEL_OBJS = build/common/utils.o \ 17 build/common/vmem.o \ 18 build/fat32/fat32.o \ 19 build/drivers/dma_driver.o \ 20 build/drivers/fbf_driver.o \ 21 build/drivers/xcu_driver.o \ 22 build/drivers/icu_driver.o \ 23 build/drivers/ioc_driver.o \ 24 build/drivers/iob_driver.o \ 25 build/drivers/mmc_driver.o \ 26 build/drivers/mwr_driver.o \ 27 build/drivers/nic_driver.o \ 28 build/drivers/tim_driver.o \ 29 build/drivers/tty_driver.o \ 30 build/kernel/giet.o \ 31 build/kernel/switch.o \ 32 build/kernel/ctx_handler.o \ 33 build/kernel/exc_handler.o \ 34 build/kernel/sys_handler.o \ 35 build/kernel/irq_handler.o \ 36 build/kernel/kernel_init.o 37 38 ### Objects to be linked for boot.elf 39 BOOT_OBJS = build/common/utils.o \ 40 build/common/vmem.o \ 41 build/fat32/fat32.o \ 42 build/drivers/tty_driver.o \ 43 build/drivers/xcu_driver.o \ 44 build/drivers/dma_driver.o \ 45 build/drivers/mwr_driver.o \ 46 build/drivers/ioc_driver.o \ 47 build/drivers/nic_driver.o \ 48 build/drivers/mmc_driver.o \ 49 build/kernel/ctx_handler.o \ 50 build/kernel/switch.o \ 51 build/boot/boot.o 52 53 ### Objects to be linked for display.elf 23 54 DISPLAY_OBJS = build/display/main.o \ 24 build/libs/stdio.o \ 25 build/libs/utils.o 26 27 ROUTER_OBJS = build/router/main.o \ 28 build/libs/mwmr_channel.o \ 29 build/libs/stdio.o \ 30 build/libs/utils.o 31 32 HELLO_OBJS = build/hello/main.o \ 33 build/libs/stdio.o \ 34 build/libs/utils.o 35 36 PGCD_OBJS = build/pgcd/main.o \ 37 build/libs/stdio.o \ 38 build/libs/utils.o 39 40 GAMEOFLIFE_OBJS = build/gameoflife/main.o \ 41 build/libs/stdio.o \ 42 build/libs/barrier.o 43 55 build/libs/stdio.o 56 57 ### Objects to be linked for router.elf 58 ROUTER_OBJS = build/router/main.o \ 59 build/libs/mwmr_channel.o \ 60 build/libs/stdio.o 61 62 ### Objects to be linked for hello.elf 63 HELLO_OBJS = build/hello/main.o \ 64 build/libs/stdio.o 65 66 ### Objects to be linked for pgcd.elf 67 PGCD_OBJS = build/pgcd/main.o \ 68 build/libs/stdio.o 69 70 ### Objects to be linked for game.elf 71 GAMEOFLIFE_OBJS = build/gameoflife/main.o \ 72 build/libs/stdio.o \ 73 build/libs/barrier.o 74 75 ### Objects to be linked for dhrystone.elf 44 76 DHRYSTONE_OBJS = build/dhrystone/dhry_1.o \ 45 77 build/dhrystone/dhry_2.o \ 46 build/libs/stdio.o \ 47 build/libs/utils.o \ 48 build/libs/string.o \ 49 build/libs/spin_lock.o \ 78 build/libs/stdio.o \ 79 build/libs/string.o \ 80 build/libs/spin_lock.o \ 50 81 build/libs/malloc.o 51 82 52 SORT_OBJS = build/sort/main.o \ 53 build/libs/stdio.o \ 54 build/libs/barrier.o 83 ### Objects to be linked for sort.elf 84 SORT_OBJS = build/sort/main.o \ 85 build/libs/stdio.o \ 86 build/libs/spin_lock.o \ 87 build/libs/barrier.o 88 55 89 56 90 CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 57 91 58 INCLUDE = -Iboot -Isys -Ixml -Ilibs -I. 59 60 all: map.bin soft.elf 61 62 ## merge all *.elf and map.bin to soft.elf 63 soft.elf: build/boot/boot.elf \ 64 build/sys/sys.elf \ 65 build/display/display.elf \ 66 build/router/router.elf \ 67 build/pgcd/pgcd.elf \ 68 build/hello/hello.elf \ 69 build/gameoflife/gameoflife.elf \ 70 build/dhrystone/dhrystone.elf \ 71 build/sort/sort.elf \ 72 73 $(MAKE) -C memo 74 memo/memo.x map.bin 75 $(DU) -D $@ > build$@.txt 92 GIET_INCLUDE = -Igiet_boot \ 93 -Igiet_kernel \ 94 -Igiet_xml \ 95 -Igiet_fat32 \ 96 -Igiet_drivers \ 97 -Igiet_common \ 98 -Igiet_libs \ 99 -I. 100 101 USER_INCLUDE = -Igiet_libs \ 102 -Igiet_xml \ 103 -I. 104 105 all: map.bin \ 106 build/boot/boot.elf \ 107 build/kernel/kernel.elf \ 108 build/display/display.elf \ 109 build/router/router.elf \ 110 build/hello/hello.elf \ 111 build/pgcd/pgcd.elf \ 112 build/dhrystone/dhrystone.elf \ 113 build/gameoflife/gameoflife.elf \ 114 build/sort/sort.elf \ 115 hdd/virt_hdd.dmg 116 117 ### Disk image generation 118 ### This requires the generic LINUX/MacOS sript "create_dmg" script 119 ### written by C.Fuguet. (should be installed in GIET-VM root directory). 120 hdd/virt_hdd.dmg: map.bin \ 121 build/boot/boot.elf \ 122 build/kernel/kernel.elf \ 123 build/display/display.elf \ 124 build/hello/hello.elf \ 125 build/pgcd/pgcd.elf \ 126 build/router/router.elf \ 127 build/dhrystone/dhrystone.elf \ 128 build/gameoflife/gameoflife.elf 129 ### remove all content of virtual disk virt_hdd 130 rm -rf hdd/virt_hdd/* 131 ### copy content to virtual disk from build, misc and map.bin 132 ### the boot.elf file is not copied on the virtual disk 133 cp -r build hdd/virt_hdd 134 rm -rf hdd/virt_hdd/build/boot 135 cp -r hdd/misc hdd/virt_hdd 136 cp map.bin hdd/virt_hdd 137 ### create temporary partition image (partition_image.dmg) 138 ./create_dmg create hdd/virt_hdd partition_image 139 ### copy standard MBR into virtual disk image (mbr.dmg) 140 cp hdd/mbr.dmg $@ 141 ### copy boot.elf into virtual disk image (sector 2) 142 dd if=build/boot/boot.elf of=$@ seek=2 143 ### copy partition image into virtual disk image (sector 300) 144 dd if=partition_image.dmg of=$@ seek=300 145 ### remove partition image 146 rm partition_image.dmg 76 147 77 148 ### mapping compilation 78 149 map.bin: $(MAP_XML) 79 $(MAKE) -C xml 80 xml/xml2bin $< . 81 82 ### system compilation 83 build/sys/sys.elf: $(SYS_OBJS) sys/sys.ld 84 $(LD) -o $@ -T sys/sys.ld $(SYS_OBJS) 85 $(DU) -D $@ > $@.txt 86 87 build/sys/%.o: sys/%.c giet_config.h $(MAP_XML) 88 $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $< 89 90 build/sys/%.o: sys/%.s giet_config.h $(MAP_XML) 91 $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $< 150 $(MAKE) -C giet_xml 151 giet_xml/xml2bin $< . 152 153 ### drivers compilation 154 build/drivers/dma_driver.o: giet_drivers/dma_driver.c \ 155 giet_drivers/dma_driver.h \ 156 giet_config.h \ 157 $(MAP_XML) 158 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 159 160 build/drivers/fbf_driver.o: giet_drivers/fbf_driver.c \ 161 giet_drivers/fbf_driver.h \ 162 giet_config.h \ 163 $(MAP_XML) 164 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 165 166 build/drivers/xcu_driver.o: giet_drivers/xcu_driver.c \ 167 giet_drivers/xcu_driver.h \ 168 giet_config.h \ 169 $(MAP_XML) 170 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 171 172 build/drivers/icu_driver.o: giet_drivers/icu_driver.c \ 173 giet_drivers/icu_driver.h \ 174 giet_config.h \ 175 $(MAP_XML) 176 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 177 178 build/drivers/ioc_driver.o: giet_drivers/ioc_driver.c \ 179 giet_drivers/ioc_driver.h \ 180 giet_config.h \ 181 $(MAP_XML) 182 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 183 184 build/drivers/iob_driver.o: giet_drivers/iob_driver.c \ 185 giet_drivers/iob_driver.h \ 186 giet_config.h \ 187 $(MAP_XML) 188 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 189 190 build/drivers/mmc_driver.o: giet_drivers/mmc_driver.c \ 191 giet_drivers/mmc_driver.h \ 192 giet_config.h \ 193 $(MAP_XML) 194 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 195 196 build/drivers/mwr_driver.o: giet_drivers/mwr_driver.c \ 197 giet_drivers/mwr_driver.h \ 198 giet_config.h \ 199 $(MAP_XML) 200 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 201 202 build/drivers/nic_driver.o: giet_drivers/nic_driver.c \ 203 giet_drivers/nic_driver.h \ 204 giet_config.h \ 205 $(MAP_XML) 206 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 207 208 build/drivers/tim_driver.o: giet_drivers/tim_driver.c \ 209 giet_drivers/tim_driver.h \ 210 giet_config.h \ 211 $(MAP_XML) 212 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 213 214 build/drivers/tty_driver.o: giet_drivers/tty_driver.c \ 215 giet_drivers/tty_driver.h \ 216 giet_config.h \ 217 $(MAP_XML) 218 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 219 220 ### fat32 compilation 221 build/fat32/fat32.o: giet_fat32/fat32.c \ 222 giet_fat32/fat32.h \ 223 giet_config.h \ 224 $(MAP_XML) 225 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 226 227 ### utils compilation 228 build/common/utils.o: giet_common/utils.c \ 229 giet_common/utils.h \ 230 giet_config.h \ 231 $(MAP_XML) 232 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 233 234 ### vmem compilation 235 build/common/vmem.o: giet_common/vmem.c \ 236 giet_common/vmem.h \ 237 giet_config.h \ 238 $(MAP_XML) 239 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 92 240 93 241 ### boot compilation 94 build/boot/boot.elf: $(BOOT_OBJS) boot/boot.ld 95 $(LD) -o $@ -T boot/boot.ld $(BOOT_OBJS) 96 $(DU) -D $@ > $@.txt 97 98 build/boot/%.o: boot/%.c giet_config.h $(MAP_XML) 99 $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $< 100 101 build/boot/%.o: boot/%.S giet_config.h $(MAP_XML) 102 $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $< 242 build/boot/boot.elf: $(BOOT_OBJS) 243 $(LD) -o $@ -T giet_boot/boot.ld $(BOOT_OBJS) 244 $(DU) -D $@ > $@.txt 245 246 build/boot/boot.o: giet_boot/boot.c \ 247 giet_common/utils.h \ 248 giet_fat32/fat32.h \ 249 giet_common/vmem.h \ 250 giet_drivers/tty_driver.h \ 251 giet_drivers/ioc_driver.h \ 252 giet_config.h \ 253 $(MAP_XML) 254 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 255 256 ### kernel compilation 257 build/kernel/kernel.elf: $(KERNEL_OBJS) giet_kernel/kernel.ld 258 $(LD) -o $@ -T giet_kernel/kernel.ld $(KERNEL_OBJS) 259 $(DU) -D $@ > $@.txt 260 261 build/kernel/%.o: giet_kernel/%.c giet_config.h $(MAP_XML) 262 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 263 264 build/kernel/%.o: giet_kernel/%.s giet_config.h $(MAP_XML) 265 $(CC) $(GIET_INCLUDE) $(CFLAGS) -c -o $@ $< 266 267 268 269 270 ### libs compilation 271 build/libs/stdio.o: giet_libs/stdio.c \ 272 giet_libs/stdio.h \ 273 giet_config.h 274 $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< 275 276 build/libs/mwmr_channel.o: giet_libs/mwmr_channel.c \ 277 giet_libs/mwmr_channel.h \ 278 giet_config.h 279 $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< 280 281 build/libs/malloc.o: giet_libs/malloc.c \ 282 giet_libs/malloc.h \ 283 giet_libs/malloc_private.h \ 284 giet_config.h 285 $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< 286 287 build/libs/barrier.o: giet_libs/barrier.c \ 288 giet_libs/barrier.h \ 289 giet_config.h 290 $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< 291 292 build/libs/string.o: giet_libs/string.c \ 293 giet_libs/string.h \ 294 giet_config.h 295 $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< 296 297 build/libs/spin_lock.o: giet_libs/spin_lock.c \ 298 giet_libs/spin_lock.h \ 299 giet_config.h 300 $(CC) $(CFLAGS) $(USER_INCLUDE) -c -o $@ $< 301 302 303 103 304 104 305 ### display compilation … … 107 308 $(DU) -D $@ > $@.txt 108 309 109 build/display/main.o: display/main .c110 $(CC) $( INCLUDE) $(CFLAGS) -c -o $@ $<310 build/display/main.o: display/main_cma.c 311 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 111 312 112 313 ### router compilation … … 116 317 117 318 build/router/main.o: router/main.c 118 $(CC) $( INCLUDE) $(CFLAGS) -c -o $@ $<319 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 119 320 120 321 ### hello compilation … … 124 325 125 326 build/hello/main.o: hello/main.c 126 $(CC) $( INCLUDE) $(CFLAGS) -c -o $@ $<327 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 127 328 128 329 ### pgcd compilation … … 132 333 133 334 build/pgcd/main.o: pgcd/main.c 134 $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $< 135 335 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 136 336 137 337 ### gameoflife compilation … … 141 341 142 342 build/gameoflife/main.o: gameoflife/main.c 143 $(CC) $( INCLUDE) $(CFLAGS) -O3 -c -o $@ $<343 $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $< 144 344 145 345 ### dhrystone compilation … … 149 349 150 350 build/dhrystone/dhry_1.o: dhrystone/dhry_1.c 151 $(CC) $( INCLUDE) $(CFLAGS) -c -o $@ $<351 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 152 352 153 353 build/dhrystone/dhry_2.o: dhrystone/dhry_2.c 154 $(CC) $( INCLUDE) $(CFLAGS) -c -o $@ $<354 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 155 355 156 356 ### sort compilation 157 build/sort/sort.elf: $(SORT_OBJS) sort/sort.ld 357 build/sort/sort.elf: $(SORT_OBJS) sort/sort.ld 158 358 $(LD) -o $@ -T sort/sort.ld $(SORT_OBJS) 159 359 $(DU) -D $@ > $@.txt 160 360 161 361 build/sort/main.o: sort/main.c 162 $(CC) $(INCLUDE) $(CFLAGS) -O3 -c -o $@ $< 163 164 ### libs compilation 165 build/libs/utils.o: libs/utils.c giet_config.h 166 $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $< 167 168 build/libs/stdio.o: libs/stdio.c giet_config.h 169 $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $< 170 171 build/libs/mwmr_channel.o: libs/mwmr_channel.c 172 $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $< 173 174 build/libs/malloc.o: libs/malloc.c libs/malloc.h libs/malloc_private.h giet_config.h 175 $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $< 176 177 build/libs/barrier.o: libs/barrier.c 178 $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $< 179 180 build/libs/string.o: libs/string.c libs/string.h 181 $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $< 182 183 build/libs/spin_lock.o: libs/spin_lock.c libs/spin_lock.h 184 $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $< 362 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 185 363 186 364 ### clean 187 365 clean: 188 366 rm -f *.o *.elf *.bin *.txt core giet_vsegs.ld hard_config.h map.bin*~ 189 $(MAKE) -s clean -C xml 190 $(MAKE) -s clean -C memo 367 $(MAKE) -s clean -C giet_xml 191 368 rm -rf build/boot/* 192 rm -rf build/sys/* 369 rm -rf build/fat32/* 370 rm -rf build/common/* 371 rm -rf build/drivers/* 372 rm -rf build/kernel/* 373 rm -rf build/reset/* 193 374 rm -rf build/libs/* 194 375 rm -rf build/pgcd/* … … 198 379 rm -rf build/gameoflife/* 199 380 rm -rf build/dhrystone/* 381 rm -rf build/sort/* 382 rm -rf build/map.bin 383 rm -rf hdd/virt_hdd.dmg
Note: See TracChangeset
for help on using the changeset viewer.