Several Makefiles: Add .PHONY definitions to prevent 'clean up to date' message weirdness; Add default definitions for some commonly used things when 'make clean' is used without .config or Make.defs files installed.

This commit is contained in:
Gregory Nutt 2016-05-10 15:40:20 -06:00
parent a2e83fe135
commit 29e8b8e059
21 changed files with 104 additions and 44 deletions

View File

@ -1585,3 +1585,7 @@
greyscale.
* apps/canutils/uavcan: Update UAVCAN version. From Paul Alexander
Patience (2016-05-03)
* Several Makefiles: Add .PHONY definitions to prevent 'clean up to date'
message weirdness; Add default definitions for some commonly used
things when 'make clean' is used without .config or Make.defs files
installed (2016-05-10).

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/errno/Makefile
#
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/hello/Makefile
#
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/helloxx/Makefile
#
# Copyright (C) 2012, 2014-2015 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -98,6 +101,7 @@ LDLIBSTDC_STUBS_DIR = $(TOPDIR)/libxx
LDLIBSTDC_STUBS_LIB = $(LDLIBSTDC_STUBS_DIR)/liblibxx.a
all: $(BIN1) $(BIN2) $(BIN3) $(BIN4) $(BIN5)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.cpp
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/longjmp/Makefile
#
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/mutex/Makefile
#
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/pthread/Makefile
#
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/signal/Makefile
#
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/struct/Makefile
#
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
CELFFLAGS += -I.
ifeq ($(WINTOOL),y)
@ -70,6 +73,7 @@ SRCS = struct_main.c struct_dummy.c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/task/Makefile
#
# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -69,6 +72,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# apps/examples/module/Makefile
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,10 @@
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
include $(APPDIR)/Make.defs
# Module example built-in application info

View File

@ -1,7 +1,7 @@
############################################################################
# examples/module/drivers/chardev/Makefile
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
ifeq ($(WINTOOL),y)
NUTTXLIB = "${shell cygpath -w $(TOPDIR)$(DELIM)lib}"
else
@ -71,6 +74,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=$(OBJEXT))
all: $(BIN)
.PHONY: clean install
$(OBJS): %$(OBJEXT): %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/elf/tests/hello/Makefile
#
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
# Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=.o)
all: $(BIN)
.PHONY: clean install
$(OBJS): %.o: %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/posix_spawn/filesystem/redirect/Makefile
#
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
# Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -41,6 +41,7 @@ SRCS = $(BIN).c
OBJS = $(SRCS:.c=.o)
all: $(BIN)
.PHONY: clean install
$(OBJS): %.o: %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/thttpd/content/hello/Makefile
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -44,6 +44,7 @@ R2SRC = $(BIN)-thunk.S
R2OBJ = $(R2SRC:.S=.o)
all: $(BIN)
.PHONY: clean install
$(R1OBJS): %.o: %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/thttpd/content/netstat/Makefile
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -44,6 +44,7 @@ R2SRC = $(BIN)-thunk.S
R2OBJ = $(R2SRC:.S=.o)
all: $(BIN)
.PHONY: clean install
$(R1OBJS): %.o: %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# examples/thttpd/content/tasks/Makefile
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Copyright (C) 2009, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -35,6 +35,9 @@
-include $(TOPDIR)/Make.defs
OBJEXT ?= .o
DELIM ?= /
BIN = tasks
R1SRCS = $(BIN).c
@ -44,6 +47,7 @@ R2SRC = $(BIN)-thunk.S
R2OBJ = $(R2SRC:.S=.o)
all: $(BIN)
.PHONY: clean install
$(R1OBJS): %.o: %.c
@echo "CC: $<"

View File

@ -1,7 +1,7 @@
############################################################################
# apps/examples/usbserial/Makefile
#
# Copyright (C) 2008, 2010-2012 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2010-2012, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,7 @@
############################################################################
# apps/examples/usbserial/Makefile.host
#
# Copyright (C) 2008, 2011, 2015 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2011, 2015-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -58,6 +58,7 @@ DEFINES += -DCONFIG_CDCACM=1
endif
all: $(BIN)
.PHONY: clean
$(BIN): $(SRC)
@$(HOSTCC) $(HOSTCFLAGS) $(DEFINES) $^ -o $@

View File

@ -1,7 +1,7 @@
############################################################################
# apps/ interpreters/micropython/Makefile
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved.
# Authors: Gregory Nutt <gnutt@nuttx.org>
# Dave Marples <dave@marples.net>
#
@ -127,6 +127,7 @@ ROOTDEPPATH = --dep-path .
# Common build
all: .built
.PHONY: install context clean distclean
$(MICROPYTHON_TARBALL):
@echo "Downloading: $(MICROPYTHON_TARBALL)"

View File

@ -1,7 +1,7 @@
############################################################################
# apps/platform/Makefile
#
# Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
# Copyright (C) 2013-2014, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@ -96,7 +96,7 @@ endif
# Build targets
all: .built
.PHONY: context .depend depend clean distclean
.PHONY: $(TOPDIR)$(DELIM).config context .depend depend clean distclean
ifneq ($(ASRCS),)
$(AOBJS): bin$(DELIM)%$(OBJEXT): %.S
@ -116,6 +116,8 @@ endif
# Build context setup
$(TOPDIR)$(DELIM).config:
$(PLATFORMDIR): $(TOPDIR)$(DELIM).config
@echo "LN: platform$(DELIM)board to $(LINKDIR)"
$(Q) $(DIRUNLINK) $(PLATFORMDIR)