📄 makefile
字号:
AR = m68k-elf-ar
CC = m68k-elf-gcc
CXX = m68k-elf-g++
LD = m68k-elf-gcc
OBJCOPY = m68k-elf-objcopy
RANLIB = m68k-elf-ranlib
RM = rm -f
libsDir = .
LIBDIRS = $(libsDir)/ethernet $(libsDir)/common $(libsDir)/opentcp
LDDIRS = -L$(libsDir)/ethernet -L$(libsDir)/common -L$(libsDir)/opentcp
incDirs = -I..
CFLAGS = -g -m528x -Wall -fno-builtin $(incDirs)
LINKER_SCRIPT = 5282LITE.ld
LIBRARIES = -lethernet -lopentcp -lcommon
LDFLAGS = -nodefaultlibs -nostartfiles -nostdlib -Wl,-Map=$(basename $@).map $(LDDIRS)
LDLIBS = -Wl,--script=$(LINKER_SCRIPT)
OBJS = main.o int_handlers.o vectors.o
TNAME = opentcp_mcf5282
ELFOBJ = $(TNAME).elf
SOBJ = $(TNAME).S19
ALLOBJS = $(OBJS) $(ELFOBJ) $(SOBJ)
#------------------------------------
.SUFFIXES: # Delete the default suffixes.
.SUFFIXES: .elf .c .c++ .o .s .S .S19 .srec # Define our suffix list.
# Compiling/assembling source code.
.c.o .c++.o .s.o .S.o:
$(CC) -c $(CFLAGS) $<
# Converting file formats.
.elf.S19 .elf.srec:
$(OBJCOPY) --output-target srec $< $@
#------------------------------------
.PHONY: all clean cleanlibs cleanall $(LIBDIRS)
all: $(ALLOBJS)
libs: $(LIBDIRS)
clean:
$(RM) $(ALLOBJS) *.map
cleanall: cleanlibs clean
#------------------------------------
$(ELFOBJ): libs $(OBJS) $(LINKER_SCRIPT)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBRARIES) $(LDLIBS) -o $@
$(libsDir)/ethernet:
$(MAKE) -C $@
$(libsDir)/common:
$(MAKE) -C $@
$(libsDir)/opentcp:
$(MAKE) -C $@
cleanlibs:
$(MAKE) -C $(libsDir)/ethernet clean
$(MAKE) -C $(libsDir)/common clean
$(MAKE) -C $(libsDir)/opentcp clean
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -