OrionDesktop
Barry Initial commit 535aa62 (2 years, 4 months ago)PRODUCT=$(notdir $(abspath $(CURDIR))) CC=i686-orion-gcc CFLAGS= AS=i686-orion-as AFLAGS= LD=i686-orion-gcc LFLAGS= AS_SOURCES := $(shell find . -name '*.S') OBJS = $(sort $(subst ./,build/,$(subst .S,.o,$(AS_SOURCES)))) C_SOURCES := $(shell find . -name '*.c') OBJS += $(sort $(subst ./,build/,$(subst .c,.o,$(C_SOURCES)))) .PHONY: clean all install all: $(PRODUCT) clean: @echo "REMOVING OBJECT FILES" @mkdir -p build @rm -rf build @touch $(PRODUCT) @rm $(PRODUCT) install: $(PRODUCT) @echo "INSTALLING $^" @mkdir -p ${SYSROOT}/bin/ @install -Dm 755 $(PRODUCT) -t ${SYSROOT}/bin/ $(PRODUCT): $(OBJS) @echo "LINKING $@" @$(LD) -o $@ $^ $(LFLAGS) build/%.o: %.c @echo "COMPILING $<" @mkdir -p $(@D) @$(CC) -c $< -o $@ $(CFLAGS) build/%.o: %.S @echo "ASSEMBLING $<" @mkdir -p $(@D) @$(AS) $< -o $@ $(AFLAGS)