use nicer build messages
This commit is contained in:
parent
d489ba9755
commit
27ef95794b
4 changed files with 50 additions and 19 deletions
|
@ -69,7 +69,7 @@ default: all
|
|||
all: newlib tools $(NAME).elf
|
||||
|
||||
newlib:
|
||||
$(MAKE) ARCH=$(ARCH) BIT=$(BIT) \
|
||||
$Q$(MAKE) ARCH=$(ARCH) BIT=$(BIT) \
|
||||
LDFLAGS="$(LDFLAGS_FOR_NEWLIB)" \
|
||||
CFLAGS="$(CFLAGS_FOR_NEWLIB)" \
|
||||
NASMFLAGS="$(NASMFLAGS_FOR_NEWLIB)" \
|
||||
|
@ -98,12 +98,15 @@ $(NAME).elf:
|
|||
|
||||
clean:
|
||||
$Q$(RM) $(NAME).elf $(NAME).sym *~
|
||||
$Q$(MAKE) -C newlib clean
|
||||
$Q$(MAKE) -C tools clean
|
||||
@echo Cleaned.
|
||||
|
||||
veryclean: clean
|
||||
veryclean:
|
||||
$Q$(RM) $(NAME).elf $(NAME).sym *~
|
||||
$Q$(RM) qemu-vlan0.pcap
|
||||
$Q$(MAKE) -C newlib veryclean
|
||||
$Q$(MAKE) -C tools veryclean
|
||||
@echo Very cleaned
|
||||
|
||||
qemu: $(NAME).elf
|
||||
|
|
|
@ -18,19 +18,29 @@ MKDIR = mkdir
|
|||
TMP = $(TOPDIR)/tmp
|
||||
OPT = --disable-shared --disable-multilib --enable-newlib-hw-fp --disable-newlib-multithread --disable-newlib-reent-small
|
||||
|
||||
# Prettify output
|
||||
V = 0
|
||||
ifeq ($V,0)
|
||||
Q = @
|
||||
P = > /dev/null
|
||||
endif
|
||||
|
||||
default: $(ARCH)
|
||||
$(MAKE) ARCH=$(ARCH) BIT=$(BIT) TARGET=$(TARGET) CFLAGS+="-ffreestanding -Wall -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples depend
|
||||
$(MAKE) ARCH=$(ARCH) BIT=$(BIT) TARGET=$(TARGET) CFLAGS+="-ffreestanding -Wall -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples
|
||||
$Q$(MAKE) ARCH=$(ARCH) BIT=$(BIT) TARGET=$(TARGET) CFLAGS+="-ffreestanding -Wall -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples depend
|
||||
$Q$(MAKE) ARCH=$(ARCH) BIT=$(BIT) TARGET=$(TARGET) CFLAGS+="-ffreestanding -Wall -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples
|
||||
|
||||
$(ARCH):
|
||||
$(RM) $(TMP)
|
||||
$(MKDIR) $(TMP)
|
||||
$(CD) $(TMP); $(TOPDIR)/src/configure --target=$(TARGET) --prefix=$(TOPDIR)/$(ARCH) $(OPT) && $(MAKE) && $(MAKE) install
|
||||
@echo Build newlib
|
||||
$Q$(RM) $(TMP)
|
||||
$Q$(MKDIR) $(TMP)
|
||||
$Q$(CD) $(TMP); $(TOPDIR)/src/configure --target=$(TARGET) --prefix=$(TOPDIR)/$(ARCH) $(OPT) && $(MAKE) && $(MAKE) install
|
||||
|
||||
clean:
|
||||
$(MAKE) -C examples clean
|
||||
$(RM) $(TMP)
|
||||
@echo Cleaning newlib
|
||||
$Q$(MAKE) -C examples clean
|
||||
$Q$(RM) $(TMP)
|
||||
|
||||
veryclean: clean
|
||||
$(MAKE) -C examples clean
|
||||
$(RM) $(TOPDIR)/$(ARCH)
|
||||
veryclean:
|
||||
@echo Propper cleaning newlib
|
||||
$Q$(MAKE) -C examples veryclean
|
||||
$Q$(RM) $(TOPDIR)/$(ARCH)
|
||||
|
|
|
@ -15,25 +15,39 @@ ifeq ($(BIT),64)
|
|||
override LDFLAGS += -Wl,-n,-z,max-page-size=0x1000
|
||||
endif
|
||||
|
||||
# Prettify output
|
||||
V = 0
|
||||
ifeq ($V,0)
|
||||
Q = @
|
||||
P = > /dev/null
|
||||
endif
|
||||
|
||||
# other implicit rules
|
||||
%.o : %.c
|
||||
$(CC_FOR_TARGET) -c $(CFLAGS) -o $@ $<
|
||||
@echo [CC] $@
|
||||
$Q$(CC_FOR_TARGET) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
default: all
|
||||
|
||||
all: hello
|
||||
|
||||
hello: hello.o
|
||||
$(CC_FOR_TARGET) $(LDFLAGS) -o $@ $<
|
||||
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
||||
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
||||
chmod a-x $@.sym
|
||||
@echo [LD] $@
|
||||
$Q$(CC_FOR_TARGET) $(LDFLAGS) -o $@ $<
|
||||
$Q$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
||||
$Q$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
||||
$Qchmod a-x $@.sym
|
||||
|
||||
clean:
|
||||
$(RM) hello *.sym *.o *~
|
||||
@echo Cleaning examples
|
||||
$Q$(RM) hello *.sym *.o *~
|
||||
|
||||
veryclean:
|
||||
@echo Propper cleaning examples
|
||||
$Q$(RM) hello *.sym *.o *~
|
||||
|
||||
depend:
|
||||
$(CC_FOR_TARGET) -MM $(CFLAGS) *.c > Makefile.dep
|
||||
$Q$(CC_FOR_TARGET) -MM $(CFLAGS) *.c > Makefile.dep
|
||||
|
||||
-include Makefile.dep
|
||||
# DO NOT DELETE
|
||||
|
|
|
@ -31,6 +31,10 @@ clean:
|
|||
@echo Cleaning tools
|
||||
$Q$(RM) -rf *.o *~ make_initrd initrd.img
|
||||
|
||||
veryclean:
|
||||
@echo Propper cleaning tools
|
||||
$Q$(RM) -rf *.o *~ make_initrd initrd.img
|
||||
|
||||
depend:
|
||||
$Q$(CC) -MM $(CFLAGS) *.c > Makefile.dep
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue