[138] | 1 | ifeq ($(origin MORPHEO_TOPLEVEL), undefined) |
---|
| 2 | $(error "variable MORPHEO_TOPLEVEL is undefined"); |
---|
| 3 | else |
---|
| 4 | include $(MORPHEO_TOPLEVEL)/Makefile.tools |
---|
| 5 | include $(MORPHEO_TOPLEVEL)/Makefile.flags |
---|
[113] | 6 | endif |
---|
| 7 | |
---|
[81] | 8 | #-----[ Directory ]---------------------------------------- |
---|
[138] | 9 | DIR_LIB = $(MORPHEO_PREFIX)/lib/$(MORPHEO_TYPE) |
---|
[113] | 10 | DIR_ENVIRONMENT = . |
---|
| 11 | DIR_CACHE = Cache |
---|
| 12 | DIR_DATA = Data |
---|
| 13 | DIR_ENDIANNESS = Endianness |
---|
| 14 | DIR_QUEUE = Queue |
---|
| 15 | DIR_RAMLOCK = RamLock |
---|
| 16 | DIR_SIM2OS = Sim2OS |
---|
| 17 | DIR_TTY = TTY |
---|
[81] | 18 | |
---|
[113] | 19 | include $(DIR_CACHE)/Makefile.defs |
---|
| 20 | include $(DIR_DATA)/Makefile.defs |
---|
| 21 | include $(DIR_ENDIANNESS)/Makefile.defs |
---|
| 22 | include $(DIR_QUEUE)/Makefile.defs |
---|
| 23 | include $(DIR_RAMLOCK)/Makefile.defs |
---|
| 24 | include $(DIR_SIM2OS)/Makefile.defs |
---|
| 25 | include $(DIR_TTY)/Makefile.defs |
---|
[81] | 26 | |
---|
| 27 | #-----[ Variable ]----------------------------------------- |
---|
| 28 | |
---|
[113] | 29 | ENTITY := Environment |
---|
| 30 | DIR_SRC = $(DIR_ENVIRONMENT)/src |
---|
[88] | 31 | |
---|
[113] | 32 | include $(DIR_ENVIRONMENT)/Makefile.defs |
---|
[81] | 33 | |
---|
[113] | 34 | LIBRARY_NAME := $(ENTITY) |
---|
| 35 | LIBRARY_FILE := $(DIR_LIB)/lib$(LIBRARY_NAME).a |
---|
[81] | 36 | |
---|
[113] | 37 | Environment_OBJECTS_DEPS := $(OBJECTS) \ |
---|
| 38 | $(Cache_OBJECTS_DEPS) \ |
---|
| 39 | $(Data_OBJECTS_DEPS) \ |
---|
| 40 | $(Endianness_OBJECTS_DEPS) \ |
---|
| 41 | $(Queue_OBJECTS_DEPS) \ |
---|
| 42 | $(RamLock_OBJECTS_DEPS) \ |
---|
| 43 | $(Sim2OS_OBJECTS_DEPS) \ |
---|
| 44 | $(TTY_OBJECTS_DEPS) |
---|
| 45 | |
---|
[81] | 46 | #-----[ Rules ]-------------------------------------------- |
---|
| 47 | |
---|
[145] | 48 | all : $(DIR_LIB) |
---|
| 49 | @\ |
---|
| 50 | $(MAKE) all_parallel; \ |
---|
| 51 | $(MAKE) $(LIBRARY_FILE); |
---|
[142] | 52 | |
---|
| 53 | all_step : |
---|
[81] | 54 | @\ |
---|
[142] | 55 | $(MAKE) lib_cache; \ |
---|
| 56 | $(MAKE) lib_data; \ |
---|
| 57 | $(MAKE) lib_endianness; \ |
---|
| 58 | $(MAKE) lib_queue; \ |
---|
| 59 | $(MAKE) lib_ramlock; \ |
---|
| 60 | $(MAKE) lib_sim2os; \ |
---|
[145] | 61 | $(MAKE) lib_tty; |
---|
[81] | 62 | |
---|
[142] | 63 | all_parallel : lib_cache \ |
---|
| 64 | lib_data \ |
---|
| 65 | lib_endianness \ |
---|
| 66 | lib_queue \ |
---|
| 67 | lib_ramlock \ |
---|
| 68 | lib_sim2os \ |
---|
| 69 | lib_tty |
---|
[88] | 70 | |
---|
[142] | 71 | lib_cache : |
---|
| 72 | @\ |
---|
| 73 | $(MAKE) --directory=$(DIR_CACHE) only; |
---|
| 74 | lib_data : |
---|
| 75 | @\ |
---|
| 76 | $(MAKE) --directory=$(DIR_DATA) only; |
---|
| 77 | lib_endianness : |
---|
| 78 | @\ |
---|
| 79 | $(MAKE) --directory=$(DIR_ENDIANNESS) only; |
---|
| 80 | lib_queue : |
---|
| 81 | @\ |
---|
| 82 | $(MAKE) --directory=$(DIR_QUEUE) only; |
---|
| 83 | lib_ramlock : |
---|
| 84 | @\ |
---|
| 85 | $(MAKE) --directory=$(DIR_RAMLOCK) only; |
---|
| 86 | lib_sim2os : |
---|
| 87 | @\ |
---|
| 88 | $(MAKE) --directory=$(DIR_SIM2OS) only; |
---|
| 89 | lib_tty : |
---|
| 90 | @\ |
---|
| 91 | $(MAKE) --directory=$(DIR_TTY) only; |
---|
| 92 | |
---|
[145] | 93 | $(LIBRARY_FILE) : $(Environment_OBJECTS_DEPS) |
---|
[88] | 94 | @\ |
---|
| 95 | $(ECHO) "Archive : $@";\ |
---|
[113] | 96 | $(AR) -r $@ $(Environment_OBJECTS_DEPS);\ |
---|
[88] | 97 | $(RANLIB) $@; |
---|
| 98 | |
---|
| 99 | $(DIR_LIB) : |
---|
| 100 | @\ |
---|
| 101 | $(ECHO) "Create directory : $@";\ |
---|
[113] | 102 | $(MKDIR) $@ |
---|
[88] | 103 | |
---|
| 104 | exe_all : |
---|
| 105 | @\ |
---|
[113] | 106 | $(MAKE) --directory=$(DIR_CACHE) clean; \ |
---|
[88] | 107 | $(MAKE) --directory=$(DIR_CACHE) exe; \ |
---|
[113] | 108 | $(MAKE) --directory=$(DIR_DATA) clean; \ |
---|
[88] | 109 | $(MAKE) --directory=$(DIR_DATA) exe; \ |
---|
[113] | 110 | $(MAKE) --directory=$(DIR_ENDIANNESS) clean; \ |
---|
[88] | 111 | $(MAKE) --directory=$(DIR_ENDIANNESS) exe; \ |
---|
[113] | 112 | $(MAKE) --directory=$(DIR_QUEUE) clean; \ |
---|
[88] | 113 | $(MAKE) --directory=$(DIR_QUEUE) exe; \ |
---|
[113] | 114 | $(MAKE) --directory=$(DIR_RAMLOCK) clean; \ |
---|
[88] | 115 | $(MAKE) --directory=$(DIR_RAMLOCK) exe; \ |
---|
[113] | 116 | $(MAKE) --directory=$(DIR_SIM2OS) clean; \ |
---|
[88] | 117 | $(MAKE) --directory=$(DIR_SIM2OS) exe; \ |
---|
[113] | 118 | $(MAKE) --directory=$(DIR_TTY) clean; \ |
---|
[88] | 119 | $(MAKE) --directory=$(DIR_TTY) exe; \ |
---|
[113] | 120 | $(MAKE) clean; \ |
---|
| 121 | $(MAKE) exe; |
---|
[88] | 122 | |
---|
[81] | 123 | clean : |
---|
| 124 | @\ |
---|
| 125 | $(MAKE) --directory=$(DIR_CACHE) clean; \ |
---|
| 126 | $(MAKE) --directory=$(DIR_DATA) clean; \ |
---|
| 127 | $(MAKE) --directory=$(DIR_ENDIANNESS) clean; \ |
---|
| 128 | $(MAKE) --directory=$(DIR_QUEUE) clean; \ |
---|
| 129 | $(MAKE) --directory=$(DIR_RAMLOCK) clean; \ |
---|
| 130 | $(MAKE) --directory=$(DIR_SIM2OS) clean; \ |
---|
| 131 | $(MAKE) --directory=$(DIR_TTY) clean; \ |
---|
| 132 | $(MAKE) environment_clean; \ |
---|
| 133 | $(RM) tty_*; |
---|
| 134 | |
---|
[88] | 135 | clean_all : clean |
---|
| 136 | @\ |
---|
| 137 | $(RM) $(DIR_LIB); |
---|
[81] | 138 | |
---|
| 139 | help : |
---|
| 140 | @$(MAKE) environment_help |
---|
| 141 | |
---|
| 142 | include Makefile.Environment |
---|