[Modified] init laos compile env
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
build/
|
build/
|
||||||
|
ext/
|
||||||
@@ -43,7 +43,7 @@ add_executable(${LA_SIM_TARGET} ${LASIM_SRC})
|
|||||||
|
|
||||||
# ----- ----- 构建操作系统 ----- -----
|
# ----- ----- 构建操作系统 ----- -----
|
||||||
set(LAOS laos)
|
set(LAOS laos)
|
||||||
add_subdirectory(${LAOS})
|
# add_custom_target(${LAOS} make build)
|
||||||
|
|
||||||
|
|
||||||
# ----- ----- 构建 Verilator 项目 ----- -----
|
# ----- ----- 构建 Verilator 项目 ----- -----
|
||||||
|
|||||||
1
laos/.gitignore
vendored
Normal file
1
laos/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
build/
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
set(LA_OS_TARGET ${PROJECT_NAME}-os)
|
|
||||||
|
|
||||||
# get all cxx source files from lasim folder
|
|
||||||
file(GLOB_RECURSE LAOS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
|
|
||||||
|
|
||||||
add_executable(${LA_OS_TARGET} ${LAOS_SRC})
|
|
||||||
26
laos/Makefile
Normal file
26
laos/Makefile
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
LA_BIN_PATH := $(CURDIR)/../ext/loongarch32r-linux-gnusf-2022-05-20/bin
|
||||||
|
LA_PREFIX := loongarch32r-linux-gnusf-
|
||||||
|
|
||||||
|
CC := $(LA_BIN_PATH)/$(LA_PREFIX)gcc
|
||||||
|
CXX := $(LA_BIN_PATH)/$(LA_PREFIX)g++
|
||||||
|
OD := $(LA_BIN_PATH)/$(LA_PREFIX)objdump
|
||||||
|
OC := $(LA_BIN_PATH)/$(LA_PREFIX)objcopy
|
||||||
|
|
||||||
|
CMAKE := cmake
|
||||||
|
|
||||||
|
BUILD_DIR := build
|
||||||
|
$(shell mkdir -p $(BUILD_DIR))
|
||||||
|
|
||||||
|
BIN := neula-os
|
||||||
|
COMMON_DIR := COMMON
|
||||||
|
|
||||||
|
FILES := $(shell find src -name *.c)
|
||||||
|
|
||||||
|
.PHONY: build clean
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CC) $(FILES) -o $(BUILD_DIR)/$(BIN)
|
||||||
|
$(OD) -D $(BUILD_DIR)/$(BIN) > $(BUILD_DIR)/$(BIN).dump
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(BUILD_DIR)
|
||||||
5
laos/include/common.h
Normal file
5
laos/include/common.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#ifndef COMMON_H__
|
||||||
|
#define COMMON_H__
|
||||||
|
|
||||||
|
|
||||||
|
#endif // COMMON_H__
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
0
laos/src/common/common.c
Normal file
0
laos/src/common/common.c
Normal file
6
laos/src/main.c
Normal file
6
laos/src/main.c
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
printf("%d", 123);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user