1 | #-----[ Directory ]---------------------------------------- |
---|
2 | DIR_DOC = doc |
---|
3 | DIR_TEST = SelfTest |
---|
4 | |
---|
5 | #-----[ Variable ]----------------------------------------- |
---|
6 | OBJECTS = $(OBJECTS_COMMON) |
---|
7 | |
---|
8 | #-----[ Rules ]-------------------------------------------- |
---|
9 | .PRECIOUS : $(DIR_LIB)/%.a |
---|
10 | #.NOTPARALLEL : clean help |
---|
11 | |
---|
12 | all_component : test_env $(DIR_OBJ) $(DIR_LIB) |
---|
13 | @\ |
---|
14 | $(MAKE) $(LIBRARY); |
---|
15 | |
---|
16 | # if simulator is modelsim, libComponent.a is a directory, else is normal library generated by g++ |
---|
17 | |
---|
18 | $(DIR_LIB)/%.a : $(SOURCES) $(HEADERS) |
---|
19 | @\ |
---|
20 | case "${SIMULATOR_SYSTEMC}" in \ |
---|
21 | "modelsim") \ |
---|
22 | $(MODELTECH_VLIB) $@; \ |
---|
23 | $(MODELTECH_SCCOM) $(CFLAGS) $(SOURCES) -work $@; \ |
---|
24 | ;; \ |
---|
25 | *) \ |
---|
26 | $(MAKE) $(OBJECTS); \ |
---|
27 | if $(TEST) $$? -eq 0; then \ |
---|
28 | $(ECHO) "Archive : $*"; \ |
---|
29 | $(AR) -r $@ $(OBJECTS); \ |
---|
30 | $(RANLIB) $@; \ |
---|
31 | fi; \ |
---|
32 | ;; \ |
---|
33 | esac; |
---|
34 | |
---|
35 | $(DIR_LIB) : |
---|
36 | @\ |
---|
37 | $(ECHO) "Create directory : $@";\ |
---|
38 | $(MKDIR) $@; |
---|
39 | |
---|
40 | document : |
---|
41 | @$(MAKE) --directory=$(DIR_DOC) --makefile=Makefile |
---|
42 | |
---|
43 | component_clean : |
---|
44 | @$(RM) $(LIBRARY) |
---|
45 | # if $(TEST) -d $(DIR_DOC); then $(MAKE) --directory=$(DIR_DOC) --makefile=Makefile clean; fi; |
---|
46 | |
---|
47 | component_clean_all : component_clean |
---|
48 | @$(RM) $(DIR_LIB) |
---|
49 | # if $(TEST) -d $(DIR_DOC); then $(MAKE) --directory=$(DIR_DOC) --makefile=Makefile clean_all; fi; |
---|
50 | |
---|
51 | component_help : |
---|
52 | @\ |
---|
53 | $(ECHO) " -----[ Component ]----------------------------------";\ |
---|
54 | $(ECHO) "";\ |
---|
55 | $(ECHO) " * all_component : compile all c++ file and generate library";\ |
---|
56 | $(ECHO) " * document : Generate documantation";\ |
---|
57 | $(ECHO) " * clean : Erase all generate files";\ |
---|
58 | $(ECHO) " * help : print this text";\ |
---|
59 | $(ECHO) ""; |
---|
60 | |
---|
61 | help : |
---|
62 | @\ |
---|
63 | $(MAKE) common_help;\ |
---|
64 | $(MAKE) component_help; |
---|
65 | |
---|
66 | clean : |
---|
67 | @\ |
---|
68 | $(MAKE) common_clean ;\ |
---|
69 | $(MAKE) component_clean; |
---|
70 | |
---|
71 | clean_all : |
---|
72 | @\ |
---|
73 | $(MAKE) common_clean_all ;\ |
---|
74 | $(MAKE) component_clean_all; |
---|