Skip to content

Commit 59389fc

Browse files
committed
[Makefile] Fix Makefile to build eveyting at once.
1 parent a78ccca commit 59389fc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

2-
SUBDIRS = ucos app
2+
SUBDIRS = arduino ucos app
33

44
TARGET = ucos_sample
5+
56
OBJS = $(BUILDDIR)/app.o \
67
$(BUILDDIR)/ucos.o
78

@@ -11,16 +12,18 @@ export TOPDIR
1112
BUILDDIR = $(TOPDIR)/build
1213
export BUILDDIR
1314

14-
1515
all: subdirs $(TARGET)
1616

17+
subdirs: $(BUILDDIR)
1718
subdirs:
1819
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1; done
1920

2021
$(TARGET): $(OBJS)
2122
@$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
2223
@echo " [LD] $@ $(LDFLAGS) "
2324

25+
$(BUILDDIR):
26+
mkdir -p $(@)
2427

2528
clean:
2629
find . -name "*.o" -o -name "*.exe" | xargs rm -rf;

0 commit comments

Comments
 (0)