4 # (Oh man! This is hacky, but beautiful at the same time, much like the
11 SUBMAKE = $(MAKE) --no-print-directory
13 USRLIBS := crt0.o acess.ld ld-acess.so libacess.so libgcc.so libc.so
14 USRAPPS := init login CLIShell cat ls mount ifconfig
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))
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)
39 kmode: $(AI_MODULES) $(AI_DYNMODS) allinstall-Kernel
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)
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/$*
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
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/$*
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
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/$*
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
83 $(INSTALL_DYNMODS): install-%:
84 @BUILDTYPE=dynamic $(SUBMAKE) install -C Modules/$*
85 $(INSTALL_MODULES): install-%:
86 @BUILDTYPE=static $(SUBMAKE) install -C Modules/$*
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