BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / c629653991780509799e2e00d3b074dc0e0ef313 / Makefile

// Related

Nucleus

Barry Initial commit c629653 (3 years, 3 months ago)
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4f8fdb8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,41 @@
+PRODUCT=nucleus
+
+CC=i686-orion-gcc
+CFLAGS=-Iinclude/
+
+AS=i686-orion-as
+AFLAGS=
+
+LD=i686-orion-gcc
+LFLAGS=-T linker.ld -ffreestanding -nostdlib
+
+AS_SRC := $(shell find . -name '*.S')
+OBJS = $(sort $(subst ./,build/,$(subst .S,.o,$(AS_SRC))))
+
+C_SRC := $(shell find . -name '*.c')
+OBJS += $(sort $(subst ./,build/,$(subst .c,.o,$(C_SRC))))
+
+.PHONY: clean all install
+
+all: $(PRODUCT)
+
+clean:
+	@echo "REMOVING OBJECT FILES"
+	@mkdir -p build
+	@rm -rf build
+	@touch $(PRODUCT)
+	@rm $(PRODUCT)
+
+$(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) -c $< -o $@ $(AFLAGS)