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