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 |
---|
6 | endif |
---|
7 | |
---|
8 | #-----[ Directory ]---------------------------------------- |
---|
9 | DIR_LIB = $(MORPHEO_PREFIX)/lib/$(MORPHEO_TYPE) |
---|
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 |
---|
18 | |
---|
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 |
---|
26 | |
---|
27 | #-----[ Variable ]----------------------------------------- |
---|
28 | |
---|
29 | ENTITY := Environment |
---|
30 | DIR_SRC = $(DIR_ENVIRONMENT)/src |
---|
31 | |
---|
32 | include $(DIR_ENVIRONMENT)/Makefile.defs |
---|
33 | |
---|
34 | LIBRARY_NAME := $(ENTITY) |
---|
35 | LIBRARY_FILE := $(DIR_LIB)/lib$(LIBRARY_NAME).a |
---|
36 | |
---|
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 | |
---|
46 | #-----[ Rules ]-------------------------------------------- |
---|
47 | |
---|
48 | all : all_parallel |
---|
49 | |
---|
50 | all_step : |
---|
51 | @\ |
---|
52 | $(MAKE) lib_cache; \ |
---|
53 | $(MAKE) lib_data; \ |
---|
54 | $(MAKE) lib_endianness; \ |
---|
55 | $(MAKE) lib_queue; \ |
---|
56 | $(MAKE) lib_ramlock; \ |
---|
57 | $(MAKE) lib_sim2os; \ |
---|
58 | $(MAKE) lib_tty; \ |
---|
59 | $(MAKE) $(LIBRARY_FILE); |
---|
60 | |
---|
61 | all_parallel : lib_cache \ |
---|
62 | lib_data \ |
---|
63 | lib_endianness \ |
---|
64 | lib_queue \ |
---|
65 | lib_ramlock \ |
---|
66 | lib_sim2os \ |
---|
67 | lib_tty |
---|
68 | @\ |
---|
69 | $(MAKE) $(LIBRARY_FILE); |
---|
70 | |
---|
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 | |
---|
93 | $(LIBRARY_FILE) : $(DIR_LIB) $(Environment_OBJECTS_DEPS) |
---|
94 | @\ |
---|
95 | $(ECHO) "Archive : $@";\ |
---|
96 | $(AR) -r $@ $(Environment_OBJECTS_DEPS);\ |
---|
97 | $(RANLIB) $@; |
---|
98 | |
---|
99 | $(DIR_LIB) : |
---|
100 | @\ |
---|
101 | $(ECHO) "Create directory : $@";\ |
---|
102 | $(MKDIR) $@ |
---|
103 | |
---|
104 | exe_all : |
---|
105 | @\ |
---|
106 | $(MAKE) --directory=$(DIR_CACHE) clean; \ |
---|
107 | $(MAKE) --directory=$(DIR_CACHE) exe; \ |
---|
108 | $(MAKE) --directory=$(DIR_DATA) clean; \ |
---|
109 | $(MAKE) --directory=$(DIR_DATA) exe; \ |
---|
110 | $(MAKE) --directory=$(DIR_ENDIANNESS) clean; \ |
---|
111 | $(MAKE) --directory=$(DIR_ENDIANNESS) exe; \ |
---|
112 | $(MAKE) --directory=$(DIR_QUEUE) clean; \ |
---|
113 | $(MAKE) --directory=$(DIR_QUEUE) exe; \ |
---|
114 | $(MAKE) --directory=$(DIR_RAMLOCK) clean; \ |
---|
115 | $(MAKE) --directory=$(DIR_RAMLOCK) exe; \ |
---|
116 | $(MAKE) --directory=$(DIR_SIM2OS) clean; \ |
---|
117 | $(MAKE) --directory=$(DIR_SIM2OS) exe; \ |
---|
118 | $(MAKE) --directory=$(DIR_TTY) clean; \ |
---|
119 | $(MAKE) --directory=$(DIR_TTY) exe; \ |
---|
120 | $(MAKE) clean; \ |
---|
121 | $(MAKE) exe; |
---|
122 | |
---|
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 | |
---|
135 | clean_all : clean |
---|
136 | @\ |
---|
137 | $(RM) $(DIR_LIB); |
---|
138 | |
---|
139 | help : |
---|
140 | @$(MAKE) environment_help |
---|
141 | |
---|
142 | include Makefile.Environment |
---|