armcc Makefile.mingw

阅读更多
.PHONY: clean compile link all

VPATH=..

RVCT_HOME	= /usr/local/bin

OBJEXT		= o
EXEEXT		= axf
SRCEXT		= c

RM		= rm -fr
MKDIR		= mkdir -p
MV		= mv -f

CPPFLAGS	=
CFLAGS		=
CXXFLAGS	=
LDFLAGS		=

CC		= $(RVCT_HOME)/armcc -c
LD		= $(RVCT_HOME)/armcc -o
PROGRAMS	= demo demo2

demo_SOURCES = ./src/foo.c
demo_OBJECTS = $(patsubst %.$(SRCEXT),%.$(OBJEXT),$(demo_SOURCES))

demo2_SOURCES = ./src/foo.c
demo2_OBJECTS = $(patsubst %.$(SRCEXT),%.$(OBJEXT),$(demo2_SOURCES))

#############################################
# All targets and objects
#############################################
TARGETS =
TARGETS += $(addsuffix .$(EXEEXT),$(PROGRAMS))
OBJECTS	+= $(demo_OBJECTS)
OBJECTS	+= $(demo2_OBJECTS)

all: $(TARGETS)
compile: $(OBJECTS)
link: $(TARGETS)

.tmpdirs:
	@echo > $@
.$(SRCEXT).$(OBJEXT): .tmpdirs
	@$(MKDIR) $(dir $@)
	@echo $(dir $@) >> .tmpdirs
	$(CC) $<
	@$(MV) $(notdir $@) $(dir $@)
clean:
	$(RM) *.$(OBJEXT) *.$(EXEEXT) $(OBJS) $(TARGET)
	$(RM) $(shell test -r .tmpdirs && cat .tmpdirs)
	@echo > .tmpdirs

demo.$(EXEEXT): $(demo_OBJECTS)
	$(LD) $@ $^
demo2.$(EXEEXT): $(demo2_OBJECTS)
	$(LD) $@ $^

 

你可能感兴趣的:(armcc Makefile.mingw)