Added architectue documentation
[tpg/acess2.git] / Makefile
1 #
2 # Acess2 Core Makefile
3 #
4 # (Oh man! This is hacky, but beautiful at the same time, much like the
5 # rest of Acess)
6
7 -include Makefile.cfg
8
9 .PHONY: all clean
10
11 SUBMAKE = $(MAKE) --no-print-directory
12
13 USRLIBS := crt0.o acess.ld ld-acess.so libacess.so libgcc.so libc.so
14 USRAPPS := init login CLIShell cat ls mount ifconfig
15
16 ALL_DYNMODS = $(addprefix all-,$(DYNMODS))
17 ALL_MODULES := $(addprefix all-,$(MODULES))
18 ALL_USRLIBS := $(addprefix all-,$(USRLIBS))
19 ALL_USRAPPS := $(addprefix all-,$(USRAPPS))
20 CLEAN_DYNMODS := $(addprefix clean-,$(DYNMODS))
21 CLEAN_MODULES := $(addprefix clean-,$(MODULES))
22 CLEAN_USRLIBS := $(addprefix clean-,$(USRLIBS))
23 CLEAN_USRAPPS := $(addprefix clean-,$(USRAPPS))
24 INSTALL_DYNMODS := $(addprefix install-,$(DYNMODS))
25 INSTALL_MODULES := $(addprefix install-,$(MODULES))
26 INSTALL_USRLIBS := $(addprefix install-,$(USRLIBS))
27 INSTALL_USRAPPS := $(addprefix install-,$(USRAPPS))
28 AI_DYNMODS := $(addprefix allinstall-,$(DYNMODS))
29 AI_MODULES := $(addprefix allinstall-,$(MODULES))
30 AI_USRLIBS := $(addprefix allinstall-,$(USRLIBS))
31 AI_USRAPPS := $(addprefix allinstall-,$(USRAPPS))
32
33 .PHONY: all clean install \
34         $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS) \
35         $(AI_MODULES) allinstall-Kernel $(AI_USRLIBS) $(AI_USRAPPS) \
36         $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) \
37         $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS)
38
39 kmode:  $(AI_MODULES) $(AI_DYNMODS) allinstall-Kernel
40
41 all:    $(ALL_DYNMODS) $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS)
42 all-install:    $(AI_DYNMODS) $(AI_MODULES) allinstall-Kernel $(AI_USRLIBS) $(AI_USRAPPS)
43 clean:  $(CLEAN_DYNMODS) $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS)
44 install:        $(INSTALL_DYNMODS) $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS)
45
46 # Compile Only
47 $(ALL_DYNMODS): all-%:
48         @echo === Dynamic Module: $* && BUILDTYPE=dynamic $(SUBMAKE) all -C Modules/$*
49 $(ALL_MODULES): all-%:
50         @echo === Module: $* && BUILDTYPE=static $(SUBMAKE) all -C Modules/$*
51 all-Kernel:
52         @echo === Kernel && $(SUBMAKE) all -C Kernel
53 $(ALL_USRLIBS): all-%:
54         @echo === User Library: $* && $(SUBMAKE) all -C Usermode/Libraries/$*_src
55 $(ALL_USRAPPS): all-%:
56         @echo === User Application: $* && $(SUBMAKE) all -C Usermode/Applications/$*_src
57
58 # Compile & Install
59 $(AI_DYNMODS): allinstall-%:
60         @echo === Dynamic Module: $* && BUILDTYPE=dynamic $(SUBMAKE) all install -C Modules/$*
61 $(AI_MODULES): allinstall-%:
62         @echo === Module: $* && BUILDTYPE=static $(SUBMAKE) all install -C Modules/$*
63 allinstall-Kernel:
64         @echo === Kernel && $(SUBMAKE) all install -C Kernel
65 $(AI_USRLIBS): allinstall-%:
66         @echo === User Library: $* && $(SUBMAKE) all install -C Usermode/Libraries/$*_src
67 $(AI_USRAPPS): allinstall-%:
68         @echo === User Application: $* && $(SUBMAKE) all install -C Usermode/Applications/$*_src
69
70 # Clean up compilation
71 $(CLEAN_DYNMODS): clean-%:
72         @BUILDTYPE=dynamic $(SUBMAKE) clean -C Modules/$*
73 $(CLEAN_MODULES): clean-%:
74         @BUILDTYPE=static $(SUBMAKE) clean -C Modules/$*
75 clean-Kernel:
76         @$(SUBMAKE) clean -C Kernel
77 $(CLEAN_USRLIBS): clean-%:
78         @$(SUBMAKE) clean -C Usermode/Libraries/$*_src
79 $(CLEAN_USRAPPS): clean-%:
80         @$(SUBMAKE) clean -C Usermode/Applications/$*_src
81
82 # Install
83 $(INSTALL_DYNMODS): install-%:
84         @BUILDTYPE=dynamic $(SUBMAKE) install -C Modules/$*
85 $(INSTALL_MODULES): install-%:
86         @BUILDTYPE=static $(SUBMAKE) install -C Modules/$*
87 install-Kernel:
88         @$(SUBMAKE) install -C Kernel
89 $(INSTALL_USRLIBS): install-%:
90         @$(SUBMAKE) install -C Usermode/Libraries/$*_src
91 $(INSTALL_USRAPPS): install-%:
92         @$(SUBMAKE) install -C Usermode/Applications/$*_src

UCC git Repository :: git.ucc.asn.au