stable
This commit is contained in:
30
ccompiler/backend/Makefile
Normal file
30
ccompiler/backend/Makefile
Normal file
@ -0,0 +1,30 @@
|
||||
# 编译器设置
|
||||
CC = gcc
|
||||
AR = ar
|
||||
CFLAGS = -g -Wall -I../..
|
||||
|
||||
RISCV32_DIR = ./riscv32
|
||||
|
||||
# 源文件列表
|
||||
SRCS = \
|
||||
backend.c \
|
||||
$(RISCV32_DIR)/riscv32.c
|
||||
|
||||
# 生成目标文件列表
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
|
||||
# 最终目标
|
||||
TARGET = libbackend.a
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(AR) rcs $@ $^
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(TARGET)
|
||||
|
||||
.PHONY: all clean
|
Reference in New Issue
Block a user