- Timestamp:
- Jul 22, 2012, 9:13:57 AM (12 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 5 added
- 4 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r175 r177 8 8 SOFT_PATH = $(shell pwd)/ 9 9 10 SYS_ NAME= sys11 BOOT_NAME = boot 12 LIB_NAME = libs 10 SYS_DIR = sys 11 LIB_DIR = libs 12 BOOT_DIR = boot 13 13 14 SYS_PATH = $(SOFT_PATH)$(SYS_NAME) 15 BOOT_PATH = $(SOFT_PATH)$(BOOT_NAME) 16 LIB_PATH = $(SOFT_PATH)$(LIB_NAME) 17 MAP_PATH = $(SOFT_PATH)xml/ 14 BOOT_PATH = $(SOFT_PATH)$(BOOT_DIR) 15 SYS_PATH = $(SOFT_PATH)$(SYS_DIR) 16 LIB_PATH = $(SOFT_PATH)$(LIB_DIR) 17 XML_PATH = $(SOFT_PATH)xml/ 18 MEMO_PATH = $(SOFT_PATH)memo/ 18 19 BUILD_PATH = $(SOFT_PATH)build/ 19 20 ELF_PATH = $(SOFT_PATH)build/ 21 APP_PATH = $(SOFT_PATH)apps/ 20 22 21 23 #list of all applications directory 22 APP_DIRS = $(shell ls -d apps/*/ )24 APP_DIRS = $(shell ls -d $(APP_PATH)/*/ ) 23 25 24 26 SYS_OBJS_LIST = \ … … 37 39 boot_handler.o 38 40 39 #LIB_SRCS = $(wildcard $(LIB_ NAME)/*.c)41 #LIB_SRCS = $(wildcard $(LIB_DIR)/*.c) 40 42 LIB_OBJS_LIST = stdio.o \ 41 43 mwmr_channel.o \ … … 44 46 common.o 45 47 46 LIB_OBJS = $(patsubst %,$(LIB_NAME)/%,$(LIB_OBJS_LIST))47 SYS_OBJS = $(patsubst %,$(SYS_NAME)/%,$(SYS_OBJS_LIST))48 BOOT_OBJS = $(patsubst %,$(BOOT_ NAME)/%,$(BOOT_OBJS_LIST))48 LIB_OBJS = $(patsubst %,$(LIB_DIR)/%,$(LIB_OBJS_LIST)) 49 SYS_OBJS = $(patsubst %,$(SYS_DIR)/%,$(SYS_OBJS_LIST)) 50 BOOT_OBJS = $(patsubst %,$(BOOT_DIR)/%,$(BOOT_OBJS_LIST)) 49 51 50 52 51 53 CFLAGS=-Wall -ffreestanding -mno-gpopt -mips32 -g 52 54 53 SYS_INCLUDE = -I$(SYS_PATH) -I$( MAP_PATH) -I$(LIB_PATH) -I.54 BOOT_INCLUDE = -I$(BOOT_PATH) -I$( MAP_PATH) -I$(LIB_PATH) -I.55 LIB_INCLUDE = -I$(LIB_PATH) -I$( MAP_PATH)56 INCLUDE = -I$(LIB_PATH) -I$(MAP_PATH)55 SYS_INCLUDE = -I$(SYS_PATH) -I$(XML_PATH) -I$(LIB_PATH) -I. 56 BOOT_INCLUDE = -I$(BOOT_PATH) -I$(XML_PATH) -I$(LIB_PATH) -I. 57 LIB_INCLUDE = -I$(LIB_PATH) -I$(XML_PATH) -I. 58 APP_INCLUDE = -I$(LIB_PATH) -I$(XML_PATH) -I$(SOFT_PATH) 57 59 58 60 TRASH= /dev/null||true … … 64 66 ## merge all *.elf to soft.elf 65 67 soft.elf: boot.elf sys.elf map.bin apps 66 $(MAKE) -C memo67 memo/memo.x map.bin68 $(MAKE) -C $(MEMO_PATH) 69 $(MEMO_PATH)/memo.x map.bin 68 70 $(DU) -D $@ > $(BUILD_PATH)$@.txt 69 71 … … 72 74 @mkdir $(BUILD_PATH) 2>$(TRASH) 73 75 @mkdir $(ELF_PATH) 2>$(TRASH) 74 @mkdir $(BUILD_PATH)/$(BOOT_ NAME) 2>$(TRASH)75 @mkdir $(BUILD_PATH)/$(LIB_ NAME) 2>$(TRASH)76 @mkdir $(BUILD_PATH)/$(SYS_ NAME) 2>$(TRASH)76 @mkdir $(BUILD_PATH)/$(BOOT_DIR) 2>$(TRASH) 77 @mkdir $(BUILD_PATH)/$(LIB_DIR) 2>$(TRASH) 78 @mkdir $(BUILD_PATH)/$(SYS_DIR) 2>$(TRASH) 77 79 78 ## mapping compilation80 ### mapping compilation 79 81 map.bin: map.xml 80 $(MAKE) -C xml81 xml/xml2bin map.xmlmap.bin82 $(MAKE) -C $(XML_PATH) 83 $(XML_PATH)/xml2bin $(SOFT_PATH)map.xml $(SOFT_PATH)map.bin 82 84 83 ## system compilation85 ### system compilation 84 86 sys.elf: $(SYS_OBJS) $(SYS_PATH)/sys.ld 85 87 (cd $(BUILD_PATH); $(LD) -o $@ -T $(SYS_PATH)/sys.ld $(SYS_OBJS) ) 86 88 (cd $(BUILD_PATH); $(DU) -D $@ > $@.txt) 87 89 88 $(SYS_ NAME)/%.o: $(SYS_NAME)/%.c90 $(SYS_DIR)/%.o: $(SYS_DIR)/%.c 89 91 $(CC) $(SYS_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 90 92 91 $(SYS_ NAME)/%.o: $(SYS_NAME)/%.s93 $(SYS_DIR)/%.o: $(SYS_DIR)/%.s 92 94 $(CC) $(SYS_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 93 95 94 $(SYS_ NAME)/%.o: $(SYS_NAME)/%.S96 $(SYS_DIR)/%.o: $(SYS_DIR)/%.S 95 97 $(CC) $(SYS_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 96 98 97 ## boot compilation99 ### boot compilation 98 100 boot.elf: $(BOOT_OBJS) $(BOOT_PATH)/boot.ld 99 101 (cd $(BUILD_PATH); $(LD) -o $@ -T $(BOOT_PATH)/boot.ld $(BOOT_OBJS) ) 100 102 (cd $(BUILD_PATH); $(DU) -D $@ > $@.txt) 101 103 102 $(BOOT_ NAME)/%.o: $(BOOT_NAME)/%.c104 $(BOOT_DIR)/%.o: $(BOOT_DIR)/%.c 103 105 $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 104 106 105 $(BOOT_ NAME)/%.o: $(BOOT_NAME)/%.s107 $(BOOT_DIR)/%.o: $(BOOT_DIR)/%.s 106 108 $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 107 109 108 $(BOOT_ NAME)/%.o: $(BOOT_NAME)/%.S110 $(BOOT_DIR)/%.o: $(BOOT_DIR)/%.S 109 111 $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 110 112 111 ## libs compilation112 $(LIB_ NAME)/%.o: $(LIB_NAME)/%.c113 ### libs compilation 114 $(LIB_DIR)/%.o: $(LIB_DIR)/%.c 113 115 $(CC) $(CFLAGS) $(LIB_INCLUDE) -c -o $(BUILD_PATH)/$@ $< 114 116 115 ## applications117 ### applications 116 118 apps: $(LIB_OBJS) 117 @echo "--------------------------------------------- BUILDING APPS------------------------------------------------------"118 set -e; for d in $(APP_DIRS); do $(MAKE) -C $$d ; echo "Compiling $$d"; done119 @echo "---------------------------------------------- BUILDING APPS ---------------------------------------------------------" 120 set -e; for d in $(APP_DIRS); do $(MAKE) -f config.mk -C $$d ; echo "Compiling $$d"; done 119 121 120 ### special rules122 ### clean 121 123 clean: 122 rm -f *.o *.elf *.bin *.txt core *~ 2>$(TRASH) 123 $(MAKE) -s clean -C xml/ 2>$(TRASH) 124 $(MAKE) -s clean -C memo/ 2>$(TRASH) 125 rm -r $(BUILD_PATH) 2>$(TRASH) 126 set -e; for d in $(APP_DIRS); do $(MAKE) clean -C $$d ; done 124 rm -f *.o *.elf *.bin *.txt core *~ 2>$(TRASH) 125 $(MAKE) -s clean -C $(XML_PATH) 2>$(TRASH) 126 $(MAKE) -s clean -C $(MEMO_PATH) 2>$(TRASH) 127 rm -r $(BUILD_PATH) 2>$(TRASH) 128 rm -r $(ELF_PATH) 2>$(TRASH) 129 set -e; for d in $(APP_DIRS); do $(MAKE) clean -f config.mk -C $$d ; done
Note: See TracChangeset
for help on using the changeset viewer.