[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 | |
---|
[113] | 48 | all : |
---|
[81] | 49 | @\ |
---|
[113] | 50 | $(MAKE) --directory=$(DIR_CACHE) all; \ |
---|
| 51 | $(MAKE) --directory=$(DIR_DATA) all; \ |
---|
| 52 | $(MAKE) --directory=$(DIR_ENDIANNESS) all; \ |
---|
| 53 | $(MAKE) --directory=$(DIR_QUEUE) all; \ |
---|
| 54 | $(MAKE) --directory=$(DIR_RAMLOCK) all; \ |
---|
| 55 | $(MAKE) --directory=$(DIR_SIM2OS) all; \ |
---|
| 56 | $(MAKE) --directory=$(DIR_TTY) all; \ |
---|
[88] | 57 | $(MAKE) $(LIBRARY_FILE); |
---|
[81] | 58 | |
---|
[88] | 59 | |
---|
[114] | 60 | $(LIBRARY_FILE) : $(DIR_LIB) $(Environment_OBJECTS_DEPS) |
---|
[88] | 61 | @\ |
---|
| 62 | $(ECHO) "Archive : $@";\ |
---|
[113] | 63 | $(AR) -r $@ $(Environment_OBJECTS_DEPS);\ |
---|
[88] | 64 | $(RANLIB) $@; |
---|
| 65 | |
---|
| 66 | $(DIR_LIB) : |
---|
| 67 | @\ |
---|
| 68 | $(ECHO) "Create directory : $@";\ |
---|
[113] | 69 | $(MKDIR) $@ |
---|
[88] | 70 | |
---|
| 71 | exe_all : |
---|
| 72 | @\ |
---|
[113] | 73 | $(MAKE) --directory=$(DIR_CACHE) clean; \ |
---|
[88] | 74 | $(MAKE) --directory=$(DIR_CACHE) exe; \ |
---|
[113] | 75 | $(MAKE) --directory=$(DIR_DATA) clean; \ |
---|
[88] | 76 | $(MAKE) --directory=$(DIR_DATA) exe; \ |
---|
[113] | 77 | $(MAKE) --directory=$(DIR_ENDIANNESS) clean; \ |
---|
[88] | 78 | $(MAKE) --directory=$(DIR_ENDIANNESS) exe; \ |
---|
[113] | 79 | $(MAKE) --directory=$(DIR_QUEUE) clean; \ |
---|
[88] | 80 | $(MAKE) --directory=$(DIR_QUEUE) exe; \ |
---|
[113] | 81 | $(MAKE) --directory=$(DIR_RAMLOCK) clean; \ |
---|
[88] | 82 | $(MAKE) --directory=$(DIR_RAMLOCK) exe; \ |
---|
[113] | 83 | $(MAKE) --directory=$(DIR_SIM2OS) clean; \ |
---|
[88] | 84 | $(MAKE) --directory=$(DIR_SIM2OS) exe; \ |
---|
[113] | 85 | $(MAKE) --directory=$(DIR_TTY) clean; \ |
---|
[88] | 86 | $(MAKE) --directory=$(DIR_TTY) exe; \ |
---|
[113] | 87 | $(MAKE) clean; \ |
---|
| 88 | $(MAKE) exe; |
---|
[88] | 89 | |
---|
[81] | 90 | clean : |
---|
| 91 | @\ |
---|
| 92 | $(MAKE) --directory=$(DIR_CACHE) clean; \ |
---|
| 93 | $(MAKE) --directory=$(DIR_DATA) clean; \ |
---|
| 94 | $(MAKE) --directory=$(DIR_ENDIANNESS) clean; \ |
---|
| 95 | $(MAKE) --directory=$(DIR_QUEUE) clean; \ |
---|
| 96 | $(MAKE) --directory=$(DIR_RAMLOCK) clean; \ |
---|
| 97 | $(MAKE) --directory=$(DIR_SIM2OS) clean; \ |
---|
| 98 | $(MAKE) --directory=$(DIR_TTY) clean; \ |
---|
| 99 | $(MAKE) environment_clean; \ |
---|
| 100 | $(RM) tty_*; |
---|
| 101 | |
---|
[88] | 102 | clean_all : clean |
---|
| 103 | @\ |
---|
| 104 | $(RM) $(DIR_LIB); |
---|
[81] | 105 | |
---|
| 106 | help : |
---|
| 107 | @$(MAKE) environment_help |
---|
| 108 | |
---|
| 109 | include Makefile.Environment |
---|