Kernel/arm7 - Fiddling with PCI etc
[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 libgcc.so libc.so
14 USRLIBS += libreadline.so libnet.so liburi.so
15 USRLIBS += libaxwin2.so libimage_sif.so
16
17 USRAPPS := init login CLIShell cat ls mount
18 USRAPPS += bomb
19 #USRAPPS += pcidump
20 USRAPPS += ifconfig ping telnet irc
21 USRAPPS += axwin2
22
23 ALL_DYNMODS = $(addprefix all-,$(DYNMODS))
24 ALL_MODULES := $(addprefix all-,$(MODULES))
25 ALL_USRLIBS := $(addprefix all-,$(USRLIBS))
26 ALL_USRAPPS := $(addprefix all-,$(USRAPPS))
27 CLEAN_DYNMODS := $(addprefix clean-,$(DYNMODS))
28 CLEAN_MODULES := $(addprefix clean-,$(MODULES))
29 CLEAN_USRLIBS := $(addprefix clean-,$(USRLIBS))
30 CLEAN_USRAPPS := $(addprefix clean-,$(USRAPPS))
31 INSTALL_DYNMODS := $(addprefix install-,$(DYNMODS))
32 INSTALL_MODULES := $(addprefix install-,$(MODULES))
33 INSTALL_USRLIBS := $(addprefix install-,$(USRLIBS))
34 INSTALL_USRAPPS := $(addprefix install-,$(USRAPPS))
35 AI_DYNMODS := $(addprefix allinstall-,$(DYNMODS))
36 AI_MODULES := $(addprefix allinstall-,$(MODULES))
37 AI_USRLIBS := $(addprefix allinstall-,$(USRLIBS))
38 AI_USRAPPS := $(addprefix allinstall-,$(USRAPPS))
39
40 .PHONY: all clean install \
41         $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS) \
42         $(AI_MODULES) allinstall-Kernel $(AI_USRLIBS) $(AI_USRAPPS) \
43         $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) \
44         $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS)
45
46 kmode:  $(AI_MODULES) $(AI_DYNMODS) allinstall-Kernel
47
48 all-user: $(ALL_USRLIBS) $(ALL_USRAPPS)
49 clean-user: $(CLEAN_USRLIBS) $(CLEAN_USRAPPS)
50
51 all:    $(ALL_DYNMODS) $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS)
52 all-install:    $(AI_DYNMODS) $(AI_MODULES) allinstall-Kernel $(AI_USRLIBS) $(AI_USRAPPS)
53 clean:  $(CLEAN_DYNMODS) $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS)
54 install:        install-Filesystem $(INSTALL_DYNMODS) $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS)
55
56 # Compile Only
57 $(ALL_DYNMODS): all-%:
58         +@echo === Dynamic Module: $* && BUILDTYPE=dynamic $(SUBMAKE) all -C Modules/$*
59 $(ALL_MODULES): all-%:
60         +@echo === Module: $* && BUILDTYPE=static $(SUBMAKE) all -C Modules/$*
61 all-Kernel:
62         +@echo === Kernel && $(SUBMAKE) all -C Kernel
63 $(ALL_USRLIBS): all-%:
64         +@echo === User Library: $* && $(SUBMAKE) all -C Usermode/Libraries/$*_src
65 $(ALL_USRAPPS): all-%:
66         +@echo === User Application: $* && $(SUBMAKE) all -C Usermode/Applications/$*_src
67
68 # Compile & Install
69 $(AI_DYNMODS): allinstall-%:
70         +@echo === Dynamic Module: $* && BUILDTYPE=dynamic $(SUBMAKE) all install -C Modules/$*
71 $(AI_MODULES): allinstall-%:
72         +@echo === Module: $* && BUILDTYPE=static $(SUBMAKE) all install -C Modules/$*
73 allinstall-Kernel:
74         +@echo === Kernel && $(SUBMAKE) all install -C Kernel
75 $(AI_USRLIBS): allinstall-%:
76         +@echo === User Library: $* && $(SUBMAKE) all install -C Usermode/Libraries/$*_src
77 $(AI_USRAPPS): allinstall-%:
78         +@echo === User Application: $* && $(SUBMAKE) all install -C Usermode/Applications/$*_src
79
80 # Clean up compilation
81 $(CLEAN_DYNMODS): clean-%:
82         +@BUILDTYPE=dynamic $(SUBMAKE) clean -C Modules/$*
83 $(CLEAN_MODULES): clean-%:
84         +@BUILDTYPE=static $(SUBMAKE) clean -C Modules/$*
85 clean-Kernel:
86         +@$(SUBMAKE) clean -C Kernel
87 $(CLEAN_USRLIBS): clean-%:
88         +@$(SUBMAKE) clean -C Usermode/Libraries/$*_src
89 $(CLEAN_USRAPPS): clean-%:
90         +@$(SUBMAKE) clean -C Usermode/Applications/$*_src
91
92 # Install
93 $(INSTALL_DYNMODS): install-%:
94         @BUILDTYPE=dynamic $(SUBMAKE) install -C Modules/$*
95 $(INSTALL_MODULES): install-%:
96         @BUILDTYPE=static $(SUBMAKE) install -C Modules/$*
97 install-Filesystem:
98         @$(SUBMAKE) install -C Usermode/Filesystem
99 install-Kernel:
100         @$(SUBMAKE) install -C Kernel
101 $(INSTALL_USRLIBS): install-%:
102         @$(SUBMAKE) install -C Usermode/Libraries/$*_src
103 $(INSTALL_USRAPPS): install-%:
104         @$(SUBMAKE) install -C Usermode/Applications/$*_src

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