1 | ifeq ($(origin MORPHEO_TMP), undefined) |
---|
2 | $(error "variable MORPHEO_TMP is undefined"); |
---|
3 | endif |
---|
4 | |
---|
5 | #-----[ Directory ]---------------------------------------- |
---|
6 | DIR_LIB = $(DIR_TMP)/lib |
---|
7 | DIR_ENVIRONMENT = . |
---|
8 | DIR_CACHE = Cache |
---|
9 | DIR_DATA = Data |
---|
10 | DIR_ENDIANNESS = Endianness |
---|
11 | DIR_QUEUE = Queue |
---|
12 | DIR_RAMLOCK = RamLock |
---|
13 | DIR_SIM2OS = Sim2OS |
---|
14 | DIR_TTY = TTY |
---|
15 | |
---|
16 | include $(DIR_CACHE)/Makefile.defs |
---|
17 | include $(DIR_DATA)/Makefile.defs |
---|
18 | include $(DIR_ENDIANNESS)/Makefile.defs |
---|
19 | include $(DIR_QUEUE)/Makefile.defs |
---|
20 | include $(DIR_RAMLOCK)/Makefile.defs |
---|
21 | include $(DIR_SIM2OS)/Makefile.defs |
---|
22 | include $(DIR_TTY)/Makefile.defs |
---|
23 | |
---|
24 | #-----[ Variable ]----------------------------------------- |
---|
25 | |
---|
26 | ENTITY := Environment |
---|
27 | DIR_SRC = $(DIR_ENVIRONMENT)/src |
---|
28 | |
---|
29 | include $(DIR_ENVIRONMENT)/Makefile.defs |
---|
30 | |
---|
31 | LIBRARY_NAME := $(ENTITY) |
---|
32 | LIBRARY_FILE := $(DIR_LIB)/lib$(LIBRARY_NAME).a |
---|
33 | |
---|
34 | Environment_OBJECTS_DEPS := $(OBJECTS) \ |
---|
35 | $(Cache_OBJECTS_DEPS) \ |
---|
36 | $(Data_OBJECTS_DEPS) \ |
---|
37 | $(Endianness_OBJECTS_DEPS) \ |
---|
38 | $(Queue_OBJECTS_DEPS) \ |
---|
39 | $(RamLock_OBJECTS_DEPS) \ |
---|
40 | $(Sim2OS_OBJECTS_DEPS) \ |
---|
41 | $(TTY_OBJECTS_DEPS) |
---|
42 | |
---|
43 | #-----[ Rules ]-------------------------------------------- |
---|
44 | |
---|
45 | all : |
---|
46 | @\ |
---|
47 | $(MAKE) --directory=$(DIR_CACHE) all; \ |
---|
48 | $(MAKE) --directory=$(DIR_DATA) all; \ |
---|
49 | $(MAKE) --directory=$(DIR_ENDIANNESS) all; \ |
---|
50 | $(MAKE) --directory=$(DIR_QUEUE) all; \ |
---|
51 | $(MAKE) --directory=$(DIR_RAMLOCK) all; \ |
---|
52 | $(MAKE) --directory=$(DIR_SIM2OS) all; \ |
---|
53 | $(MAKE) --directory=$(DIR_TTY) all; \ |
---|
54 | $(MAKE) $(LIBRARY_FILE); |
---|
55 | |
---|
56 | |
---|
57 | $(LIBRARY_FILE) : $(DIR_LIB) $(Environment_OBJECTS_DEPS) |
---|
58 | @\ |
---|
59 | $(ECHO) "Archive : $@";\ |
---|
60 | $(AR) -r $@ $(Environment_OBJECTS_DEPS);\ |
---|
61 | $(RANLIB) $@; |
---|
62 | |
---|
63 | $(DIR_LIB) : |
---|
64 | @\ |
---|
65 | $(ECHO) "Create directory : $@";\ |
---|
66 | $(MKDIR) $@ |
---|
67 | |
---|
68 | exe_all : |
---|
69 | @\ |
---|
70 | $(MAKE) --directory=$(DIR_CACHE) clean; \ |
---|
71 | $(MAKE) --directory=$(DIR_CACHE) exe; \ |
---|
72 | $(MAKE) --directory=$(DIR_DATA) clean; \ |
---|
73 | $(MAKE) --directory=$(DIR_DATA) exe; \ |
---|
74 | $(MAKE) --directory=$(DIR_ENDIANNESS) clean; \ |
---|
75 | $(MAKE) --directory=$(DIR_ENDIANNESS) exe; \ |
---|
76 | $(MAKE) --directory=$(DIR_QUEUE) clean; \ |
---|
77 | $(MAKE) --directory=$(DIR_QUEUE) exe; \ |
---|
78 | $(MAKE) --directory=$(DIR_RAMLOCK) clean; \ |
---|
79 | $(MAKE) --directory=$(DIR_RAMLOCK) exe; \ |
---|
80 | $(MAKE) --directory=$(DIR_SIM2OS) clean; \ |
---|
81 | $(MAKE) --directory=$(DIR_SIM2OS) exe; \ |
---|
82 | $(MAKE) --directory=$(DIR_TTY) clean; \ |
---|
83 | $(MAKE) --directory=$(DIR_TTY) exe; \ |
---|
84 | $(MAKE) clean; \ |
---|
85 | $(MAKE) exe; |
---|
86 | |
---|
87 | clean : |
---|
88 | @\ |
---|
89 | $(MAKE) --directory=$(DIR_CACHE) clean; \ |
---|
90 | $(MAKE) --directory=$(DIR_DATA) clean; \ |
---|
91 | $(MAKE) --directory=$(DIR_ENDIANNESS) clean; \ |
---|
92 | $(MAKE) --directory=$(DIR_QUEUE) clean; \ |
---|
93 | $(MAKE) --directory=$(DIR_RAMLOCK) clean; \ |
---|
94 | $(MAKE) --directory=$(DIR_SIM2OS) clean; \ |
---|
95 | $(MAKE) --directory=$(DIR_TTY) clean; \ |
---|
96 | $(MAKE) environment_clean; \ |
---|
97 | $(RM) tty_*; |
---|
98 | |
---|
99 | clean_all : clean |
---|
100 | @\ |
---|
101 | $(RM) $(DIR_LIB); |
---|
102 | |
---|
103 | help : |
---|
104 | @$(MAKE) environment_help |
---|
105 | |
---|
106 | include Makefile.Environment |
---|