Changeset 160 for soft/giet_vm/Makefile


Ignore:
Timestamp:
Jun 12, 2012, 4:21:27 PM (12 years ago)
Author:
karaoui
Message:

giet-vm new version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/Makefile

    r158 r160  
    44DU=mipsel-unknown-elf-objdump
    55
    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.o
     6SYS_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
    1616
    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
     17BOOT_OBJS = reset.o \
     18                boot_handler.o
    3019
    3120SYS_PATH    = sys
    32 HELLO_PATH  = hello
    33 FIFO_PATH   = fifo
    34 PGCD_PATH   = pgcd
    35 ROUTER_PATH = router
     21BOOT_PATH   = boot
    3622MAP_PATH    = xml
    3723LIBS_PATH   = libs
     24BUILD_DIR_NAME  = build
    3825
    39 CFLAGS=-Wall -ffreestanding -mno-gpopt -mips32
     26CFLAGS=-Wall -ffreestanding -mno-gpopt -mips32 -g
    4027
    4128SYS_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)
    4629
    47 all: sys.bin hello.bin router.bin fifo.bin pgcd.bin map.bin
     30BOOT_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
     34TRASH= /dev/null||true
     35
     36.PHONY: apps prepare
     37
     38all: prepare soft.bin
     39       
     40
     41## merge all *.bin to soft.bin
     42soft.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
     48prepare:
     49        @mkdir $(BUILD_DIR_NAME) 2>$(TRASH)
    4850
    4951## mapping compilation
    50 
    5152map.bin: map.xml
     53        make -C xml                             #compile the parser
    5254        xml/xml2bin map.xml map.bin
    5355
    5456## system compilation
    55 
    5657sys.bin: $(SYS_OBJS) $(SYS_PATH)/sys.ld
    57         $(LD) -o $@ -T $(SYS_PATH)/sys.ld $(SYS_OBJS)
    58         $(DU) -D $@ > $@.txt
     58        (cd $(BUILD_DIR_NAME); $(LD) -o ../$@ -T ../$(SYS_PATH)/sys.ld $(SYS_OBJS) )
     59        (cd $(BUILD_DIR_NAME); $(DU) -D ../$@ > $@.txt)
    5960
    6061switch.o: $(SYS_PATH)/switch.s giet_config.h
    61         $(AS) -g -mips32 -o $@ $<
     62        $(AS) -g -mips32 -o $(BUILD_DIR_NAME)/$@ $<
    6263
    6364giet.o: $(SYS_PATH)/giet.s giet_config.h
    64         $(AS) -g -mips32 -o $@ $<
     65        $(AS) -g -mips32 -o $(BUILD_DIR_NAME)/$@ $<
    6566
    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 $@ $<
     67task_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
    7271
    7372ctx_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)/$@ $<
    7574
    7675exc_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)/$@ $<
    7877
    7978irq_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)/$@ $<
    8180
    8281sys_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)/$@ $<
    8483
    8584drivers.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)/$@ $<
    8786
    8887common.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)/$@ $<
    9089
    91 ## application "hello" compilation
     90init.o: $(SYS_PATH)/init.c giet_config.h
     91        $(CC) $(CFLAGS) $(SYS_INCLUDE) -c -o $(BUILD_DIR_NAME)/$@ $<
    9292
    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
     94boot.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)
    9697
    97 hello_stdio.o: $(LIBS_PATH)/stdio.c $(LIBS_PATH)/stdio.h giet_config.h
    98         $(CC) $(CFLAGS) $(HELLO_INCLUDE) -c -o $@ $<
     98reset.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
    99101
    100 hello_main.o: $(HELLO_PATH)/main.c giet_config.h
    101         $(CC) $(CFLAGS) $(HELLO_INCLUDE) -c -o $@ $<
     102boot_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)/$@ $<
    102104
    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
     106apps:
     107        @echo "---------------------------------------------BUILDING APPS------------------------------------------------------"
     108        make -C apps
    144109
    145110### special rules
    146 
    147111clean:
    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.