Get the build system working again with the new boot/ dir structure
[newos.git] / makefile
blob36ecd5d881cc4993accf6e20c7b6c4e023487a93
1 ifneq ($(SECOND_CALL),true)
3 # if this is the top level instantiation of make, call back into itself with
4 # the implicit rules option turned off. There has to be a simpler way
5 # to do this, but I havne't figured it out.
6 MKFLAGS := -r
8 .PHONY: all
9 all:
10 @SECOND_CALL=true $(MAKE) $(MKFLAGS) -f makefile
13 @SECOND_CALL=true $(MAKE) $(MKFLAGS) -f makefile $@
15 else
17 # figures out the system
18 include make.syscfg
20 # include top level macros
21 include macros.mk
23 # sub-makefiles have to fill these in
24 ALL_DEPS =
25 CLEAN =
26 FINAL =
27 TOOLS =
28 ALL_OBJS =
30 FINAL := $(call TOBUILDDIR, final)
31 #$(warning FINAL = $(FINAL))
33 final: $(FINAL)
35 # includes the config of the build
36 include config/make.config
38 include apps/makefile
39 include kernel/makefile
40 include kernel/addons/makefile
41 include tools/makefile
42 include lib/makefile
43 include boot/$(PLATFORM)/makefile
45 clean: $(CLEAN)
46 rm -f $(ALL_OBJS)
47 rm -f $(ALL)
48 rm -f $(FINAL)
50 depsclean:
51 rm -f $(ALL_DEPS)
53 appsclean:
54 rm -rf $(APPS_BUILD_DIR)
56 allclean: depsclean clean
57 rm -f $(TOOLS)
59 spotless:
60 rm -rf $(BUILD_DIR)
62 #$(warning ALL_OBJS = $(ALL_OBJS))
63 #$(warning ALL_DEPS = $(ALL_DEPS))
65 ifeq ($(filter $(MAKECMDGOALS), allclean), )
66 -include $(ALL_DEPS)
67 endif
69 endif