33 lines
786 B
Makefile
33 lines
786 B
Makefile
TOPDIR = $(shell pwd)
|
|
ARCH = x86
|
|
|
|
ifeq ($(ARCH),x86)
|
|
TARGET=i586-metalsvm-elf32
|
|
endif
|
|
ifeq ($(ARCH),x86_64)
|
|
TARGET=x86_64-metalsvm-elf64
|
|
endif
|
|
|
|
NEWLIB = $(TOPDIR)/$(ARCH)/$(TARGET)
|
|
RM = rm -rf
|
|
CD = cd
|
|
MKDIR = mkdir
|
|
TMP = $(TOPDIR)/tmp
|
|
OPT = --disable-shared --disable-multilib --enable-newlib-hw-fp
|
|
|
|
default: $(ARCH)
|
|
$(MAKE) -C examples depend
|
|
$(MAKE) CFLAGS+="-nostdinc -Wall -fno-builtin -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
|
|
|
|
clean:
|
|
$(MAKE) -C examples clean
|
|
$(RM) $(TMP)
|
|
|
|
veryclean: clean
|
|
$(MAKE) -C examples clean
|
|
$(RM) $(TOPDIR)/$(ARCH)
|