Changeset 88 for trunk/Softwares/Makefile.Software
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Softwares/Makefile.Software
r81 r88 1 include $(MORPHEO_TOPLEVEL)/Makefile.tools 1 # 2 # $Id$ 3 # 4 # [ Description ] 5 # 6 # Makefile 7 # 8 9 ifeq ($(origin MORPHEO_TOPLEVEL), undefined) 10 $(error "variable MORPHEO_TOPLEVEL is undefined") 11 else 12 include $(MORPHEO_TOPLEVEL)/Makefile.tools 13 endif 2 14 3 15 #-----[ Directory ]--------------------------------------------------------------- 4 DIR ECTORY_OBJ= obj5 DIR ECTORY_BIN= bin16 DIR_OBJ = obj 17 DIR_BIN = bin 6 18 7 19 EXE = soft 8 9 #-----[ Files ]-------------------------------------------------------------------10 OBJECTS = $(OBJECTS_SYS) $(OBJECTS_ASM) $(OBJECTS_C)11 20 12 21 #-----[ To the compilation ]------------------------------------------------------ … … 37 46 # -DHAVE_LIBC 38 47 OR32_AS_OPT = 39 OR32_LD_OPT = -T$(DIR ECTORY_LDSCRIPT)/or32.ld $(LIBRARY)48 OR32_LD_OPT = -T$(DIR_LDSCRIPT)/or32.ld $(LIBRARY) 40 49 OR32_OBJDUMP_OPT = -D 41 50 OR32_NM_OPT = -n 42 51 43 52 #-----[ Rules ]------------------------------------------------------------------- 44 .PRECIOUS : $(DIR ECTORY_BIN)/%.x.txt $(DIRECTORY_BIN)/%.x $(DIRECTORY_OBJ)/%.o53 .PRECIOUS : $(DIR_BIN)/%.x.txt $(DIR_BIN)/%.x $(DIR_OBJ)/%.o 45 54 46 all : test_env $(DIRECTORY_BIN)/$(EXE).x.txt 55 vpath %.h $(DIR_INC) 56 vpath %.c $(DIR_C) 57 vpath %.s $(DIR_ASM):$(DIR_SYS) 58 vpath %.o $(DIR_OBJ) 59 vpath %.x $(DIR_BIN) 47 60 48 $(DIRECTORY_BIN)/%.x.txt : $(DIRECTORY_BIN)/%.x 61 all : 49 62 @\ 50 $(ECHO) "List symbols : $*"; \ 51 $(OR32_NM) $(OR32_NM_OPT) $^ > $@.nm; \ 52 $(ECHO) "Display info : $*"; \ 53 $(OR32_OBJDUMP) $(OR32_OBJDUMP_OPT) $^ > $@; 63 $(MKDIR) $(DIR_BIN) $(DIR_OBJ); \ 64 $(MAKE) $(DIR_BIN)/$(EXE).x; 54 65 55 $(DIRECTORY_BIN)/%.x : $(OBJECTS) 56 @ \ 57 $(ECHO) "Linkage : $*"; \ 58 $(OR32_LD) -o $@ $^ $(OR32_LD_OPT); 66 $(DIR_BIN)/%.x : $(OBJECTS) 67 @\ 68 $(ECHO) "Linkage : $*.x"; \ 69 $(OR32_LD) -o $@ $^ $(OR32_LD_OPT); \ 70 $(ECHO) "List symbols : $*.x.nm"; \ 71 $(OR32_NM) $(OR32_NM_OPT) $^ > $@.nm; \ 72 $(ECHO) "Display info : $*.x.txt"; \ 73 $(OR32_OBJDUMP) $(OR32_OBJDUMP_OPT) $^ > $@.txt; 59 74 60 $(DIR ECTORY_OBJ)/%.o : $(DIRECTORY_ASM)/%.s61 @ 62 $(ECHO) "Compilation : $* "; \63 $(OR32_CC) $(OR32_CC_OPT) -o $@ -c $^ ; 75 $(DIR_OBJ)/%.o : %.s 76 @\ 77 $(ECHO) "Compilation : $*.s"; \ 78 $(OR32_CC) $(OR32_CC_OPT) -o $@ -c $^ ; \ 64 79 $(OR32_CC) $(OR32_CC_OPT) -S -o $@.s -c $^ ; 65 80 # @$(OR32_AS) $(OR32_AS_OPT) $^ -o $@ 66 81 67 $(DIR ECTORY_OBJ)/%.o : $(DIRECTORY_SYS)/%.s68 @ 69 $(ECHO) "Compilation : $* "; \70 $(OR32_CC) $(OR32_CC_OPT) -o $@ -c $^ ; 82 $(DIR_OBJ)/%.o : %.c 83 @\ 84 $(ECHO) "Compilation : $*.c"; \ 85 $(OR32_CC) $(OR32_CC_OPT) -o $@ -c $^ ; \ 71 86 $(OR32_CC) $(OR32_CC_OPT) -S -o $@.s -c $^ ; 72 # @$(OR32_AS) $(OR32_AS_OPT) $^ -o $@73 74 $(DIRECTORY_OBJ)/%.o : $(DIRECTORY_C)/%.c75 @ \76 $(ECHO) "Compilation : $*"; \77 $(OR32_CC) $(OR32_CC_OPT) -o $@ -c $^ ; \78 $(OR32_CC) $(OR32_CC_OPT) -S -o $@.s -c $^ ;79 80 #-----[ Environement ]------------------------------------------------------------81 test_env :82 # ifeq ($(origin TOOLS), undefined)83 # $(error "variable TOOLS is undefined");84 # endif85 # ifeq ($(origin SOFT), undefined)86 # $(error "variable SOFT is undefined");87 # endif88 @$(MKDIR) $(DIRECTORY_OBJ) $(DIRECTORY_BIN)89 87 90 88 #-----[ Maintenance ]------------------------------------------------------------- 91 89 clean : 92 90 @\ 93 $(ECHO) "Delete temporary files "`$(PWD)`; \ 94 $(RM) $(DIRECTORY_OBJ) $(DIRECTORY_BIN); \ 95 $(MAKE) clean_rec DIRECTORY_CLEAN=.; 91 $(ECHO) "Delete temporary files"; \ 92 $(RM) $(DIR_OBJ) $(DIR_BIN) \ 93 *~ \ 94 $(DIR_SRC)/*~ \ 95 $(DIR_C)/*~ \ 96 $(DIR_ASM)/*~ \ 97 $(DIR_SYS)/*~ \ 98 $(DIR_INC)/*~ \ 99 $(DIR_LDSCRIPT)/*~ \ 96 100 97 clean_rec : 98 @\ 99 $(ECHO) "Delete temporary files in directory $(DIRECTORY_CLEAN)"; \ 100 $(RM) -f $(DIRECTORY_CLEAN)/*~; \ 101 for files in `$(LS) $(DIRECTORY_CLEAN)`; do \ 102 if $(TEST) -d $(DIRECTORY_CLEAN)/$$files; \ 103 then \ 104 $(MAKE) clean_rec DIRECTORY_CLEAN=$(DIRECTORY_CLEAN)/$$files; \ 105 fi; \ 106 done; 101 clean_all : clean 107 102 108 103 #-----[ Help ]-------------------------------------------------------------------- … … 111 106 $(ECHO) "";\ 112 107 $(ECHO) "List of directive : ";\ 113 $(ECHO) " * make : Compile the software";\ 114 $(ECHO) " * make clean : Erase all files generates";\ 108 $(ECHO) " * all : Compile the software";\ 109 $(ECHO) " * clean : Erase all files generates";\ 110 $(ECHO) " * clean_all : Erase all files generates";\ 115 111 $(ECHO) "";
Note: See TracChangeset
for help on using the changeset viewer.