#
#
-AS = nasm
-RM = rm -f
+-include ../Makefile.cfg
-ASFLAGS = -felf
+BIN = $(OUTPUTDIR)Libs/crt0.o $(OUTPUTDIR)Libs/crt0S.o $(OUTPUTDIR)Libs/crti.o $(OUTPUTDIR)Libs/crtn.o
-.PHONY: all clean
+CFLAGS := -std=c99
-all: ../crt0.o
+.PHONY: all clean install utest utest-build generate_exp
-install:
+all: $(BIN)
+
+install: $(BIN)
clean:
- $(RM) ../crt0.o
+ $(RM) $(BIN)
+
+# Disabled unit tests
+utest generate_exp utest-build utest-run:
+ @echo > /dev/null
+
+$(OUTPUTDIR)Libs/%S.o: %S.c Makefile
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) -c $< -o $@ -fPIC
+$(OUTPUTDIR)Libs/%.o: %.c Makefile
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) -c $< -o $@
+$(OUTPUTDIR)Libs/%.o: $(ARCHDIR)-%.S
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) -c $< -o $@
-../crt0.o: crt0.asm
- $(AS) $(ASFLAGS) $< -o $@