2 # Copyright © 1995-96, The AROS Development Team. All rights reserved.
5 # Desc: Amiga bootloader -- makefile
9 # The files in this directory build a stand-alone executable, used to
10 # install AROS' modules in the system. These modules will become active
11 # after a reset. More information in the source and doc files.
15 include $(TOP)/config/make.cfg
17 # Set this to "true" to prevent stripping of the executables.
20 # Directories where the resulting files will end up
21 BOOTGENDIR = $(GENDIR)/boot
22 TOOLDIR = $(BINDIR)/Tools
23 TOOLGENDIR = $(GENDIR)/tools
25 # Flags to use for the module loader
28 FILES = main ils config
29 TOOLZ = printresmodules showvecs
30 TOOLS = $(foreach f,$(TOOLZ),$(TOOLDIR)/$(f))
31 LIBS = -L$(LIBDIR) -larosc
33 .SUFFIXES: # Delete the default suffixes
34 .SUFFIXES: .c .o .h .d # Define our suffix list
36 .PHONY: all clean setup
38 #MM arosboot : arosboot-setup
39 arosboot : $(BINDIR)/arosboot $(BINDIR)/arosboot.config $(BINDIR)/arosboot.doc $(TOOLS)
43 -rm -f $(BINDIR)/arosboot $(BINDIR)/arosboot.config $(BINDIR)/arosboot.doc
48 @$(IF) [ ! -d $(BINDIR) ]; then $(MKDIR) $(BINDIR) ; else true ; fi
49 @$(IF) [ ! -d $(BOOTGENDIR) ]; then $(MKDIR) $(BOOTGENDIR) ; else true ; fi
50 @$(IF) [ ! -d $(TOOLDIR) ]; then $(MKDIR) $(TOOLDIR) ; else true ; fi
51 @$(IF) [ ! -d $(TOOLGENDIR) ]; then $(MKDIR) $(TOOLGENDIR) ; else true ; fi
53 $(BOOTGENDIR)/%.o: %.c
54 @$(ECHO) "Compiling $<..."
55 @$(CC) $(CFLAGS) $< -c -o $@ 2>&1|tee $*.err
56 @$(IF) [ ! -s $*.err ]; then rm $*.err ; else true ; fi
58 $(TOOLGENDIR)/%.o: %.c
59 @$(ECHO) "Compiling $<..."
60 @$(CC) $(CFLAGS) $< -c -o $@ 2>&1|tee $*.err
61 @$(IF) [ ! -s $*.err ]; then rm $*.err ; else true ; fi
63 $(BINDIR)/arosboot: $(foreach f,$(FILES),$(BOOTGENDIR)/$(f).o)
64 @$(ECHO) "Building $@..."
65 @$(CC) $(LDFLAGS) $(foreach f,$(FILES),$(BOOTGENDIR)/$(f).o) $(LIBS) -o $@
68 $(BINDIR)/arosboot.config: arosboot.config
69 @$(ECHO) "Updating $@..."
72 $(BINDIR)/arosboot.doc: arosboot.doc
73 @$(ECHO) "Updating $@..."
76 $(TOOLDIR)/%: $(TOOLGENDIR)/%.o
77 @$(ECHO) "Building $@..."
78 @$(CC) $(LDFLAGS) $< -o $@
81 $(BOOTGENDIR)/%.d: %.c
82 @$(IF) [ ! -d $(@D) ]; then $(MKDIR) $(@D) ; else $(NOP) ; fi
83 @$(ECHO) "Makedepend $(CURDIR)/$<..."
84 @$(MKDEPEND) $(CFLAGS) $< -o $@
86 $(TOOLGENDIR)/%.d: %.c
87 @$(IF) [ ! -d $(@D) ]; then $(MKDIR) $(@D) ; else $(NOP) ; fi
88 @$(ECHO) "Makedepend $(CURDIR)/$<..."
89 @$(MKDEPEND) $(CFLAGS) $< -o $@
91 # @$(MKDEPEND) -f- -p$(@D)/ -- $(CFLAGS) -- $^ > $@
93 # Don't try to include dependency files if we're cleaning or setting up.
94 ifneq ("$(TARGET)","clean")
95 ifneq ("$(TARGET)","setup")
96 include $(foreach f,$(FILES),$(BOOTGENDIR)/$(f).d)
97 include $(foreach f,$(TOOLZ),$(TOOLGENDIR)/$(f).d)