new makefile works
This commit is contained in:
parent
ec6f9cdbe2
commit
86d5df015d
4
Makefile
4
Makefile
|
@ -5,8 +5,8 @@ AM_HOME ?= $(shell pwd)
|
|||
.PHONY: all clean
|
||||
|
||||
all:
|
||||
@cd am && build ARCH=$(ARCH)
|
||||
@cd klib && build ARCH=$(ARCH)
|
||||
@cd am && make ARCH=$(ARCH)
|
||||
@cd klib && make ARCH=$(ARCH)
|
||||
|
||||
clean:
|
||||
@cd am && make clean
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.DEFAULTGOAL = app
|
||||
.DEFAULT_GOAL = app
|
||||
|
||||
$(info Building $(NAME) [$(ARCH)])
|
||||
include $(AM_HOME)/Makefile.check
|
||||
|
@ -15,8 +15,7 @@ include $(AM_HOME)/Makefile.compile
|
|||
.PHONY: app clean
|
||||
app: $(OBJS)
|
||||
@cd $(AM_HOME) && make ARCH=$(ARCH)
|
||||
@$(AM_HOME)/am/arch/$(ARHC)/img/build $(BINARY) $(AM_HOME)/am/build/am-$(ARCH).a $(AM_HOME)/klib/build/klib-$(ARCH).a $(OBJS)
|
||||
@echo "Hello"
|
||||
@$(AM_HOME)/am/arch/$(ARCH)/img/build $(BINARY) $(AM_HOME)/am/build/am-$(ARCH).a $(AM_HOME)/klib/build/klib-$(ARCH).a $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -rf $(APP_DIR)/build/
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
ifneq ($(MAKECMDGOALS),clean)
|
||||
ifndef ARCH
|
||||
$(error "ARCH must be defined")
|
||||
$(error variable ARCH must be defined)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ include $(AM_HOME)/Makefile.compile
|
|||
|
||||
.PHONY: lib
|
||||
lib: $(ARCHIVE)
|
||||
@echo "Done"
|
||||
|
||||
$(ARCHIVE): $(OBJS)
|
||||
ar rcs $(ARCHIVE) $(OBJS)
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
NAME = am
|
||||
SRCS = $(shell find -L ./arch/$(ARCH)/ -name "*.c" -o -name "*.cpp" -o -name "*.S")
|
||||
SRCS = $(shell find -L ./arch/$(ARCH)/src/ -name "*.c" -o -name "*.cpp" -o -name "*.S")
|
||||
include $(AM_HOME)/Makefile.lib
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
DIR=./am/arch/mips32-minimal/img
|
||||
DIR=${AM_HOME}/am/arch/mips32-minimal/img
|
||||
DEST=$1
|
||||
shift
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
DIR=./am/arch/mips32-npc/img
|
||||
DIR=${AM_HOME}/am/arch/mips32-npc/img
|
||||
DEST=$1
|
||||
shift
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
DIR=./am/arch/x86-qemu/img
|
||||
DIR=${AM_HOME}/am/arch/x86-qemu/img
|
||||
DEST=$1
|
||||
shift
|
||||
|
||||
ld -melf_i386 -Ttext 0x00100000 -o ./build/kernel.o --start-group $@ --end-group
|
||||
bash -c "cd $DIR/boot && make"
|
||||
cat "$DIR/boot/mbr" ./build/kernel.o > ${DEST}
|
||||
ld -melf_i386 -Ttext 0x00100000 -o ${DEST}.o --start-group $@ --end-group && \
|
||||
bash -c "cd $DIR/boot && make" && \
|
||||
cat "$DIR/boot/mbr" ${DEST}.o > ${DEST}
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
NAME = litenes
|
||||
SRCS = $(shell find -L ./src/ -name "*.c" -o -name "*.cpp" -o -name "*.S")
|
||||
include $(AM_HOME)/Makefile.app
|
Loading…
Reference in New Issue