[PATCH] add 'all' target to makefile

Dirk Hohndel dirk at hohndel.org
Tue Feb 26 12:22:14 PST 2013


In the meantime Linux suggested a different solution to me in personal
email that I have just committed...

commit 1fd2091759505b314cc62239edeffac343261a24
Author: Dirk Hohndel <dirk at hohndel.org>
Date:   Tue Feb 26 12:19:01 2013 -0800

    Get make to rebuild Subsurface by default again
    
    To quote Linus:
    
      Move the rule for the new version thing down.
    
      Plain "make" will try to make the first target in the Makefile.
    
    Suggested-by: Linus Torvalds <torvalds at linux-foundation.org>
    Signed-off-by: Dirk Hohndel <dirk at hohndel.org>

diff --git a/Makefile b/Makefile
index f0d1b8e..f3fb4e5 100644
--- a/Makefile
+++ b/Makefile
@@ -163,15 +163,15 @@ OBJS =    main.o dive.o time.o profile.o info.o equipment.o divelist.o deco.o plann
 
 DEPS = $(wildcard .dep/*.dep)
 
+$(NAME): gen_version_file $(OBJS) $(MSGOBJS) $(INFOPLIST)
+       $(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
+
 gen_version_file:
 ifneq ($(STORED_VERSION_STRING),$(VERSION_STRING))
        $(info updating $(VERSION_FILE) to $(VERSION_STRING))
        @echo \#define VERSION_STRING \"$(VERSION_STRING)\" >$(VERSION_FILE)
 endif
 
-$(NAME): gen_version_file $(OBJS) $(MSGOBJS) $(INFOPLIST)
-       $(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
-
 install: $(NAME)
        $(INSTALL) -d -m 755 $(BINDIR)
        $(INSTALL) $(NAME) $(BINDIR)



This is exactly what you did only that you added the new 'all' target as
first one while this moves $(NAME) to the top (and that then builds
gen_version_file because of the dependency)

Please test what I just pushed

/D

me at bearsh.org writes:

> From: Martin Gysel <me at bearsh.org>
>
> Signed-off-by: Martin Gysel <me at bearsh.org>
> ---
>  Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index f0d1b8e..88f3428 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -163,13 +163,15 @@ OBJS =	main.o dive.o time.o profile.o info.o equipment.o divelist.o deco.o plann
>  
>  DEPS = $(wildcard .dep/*.dep)
>  
> +all: gen_version_file $(NAME)
> +
>  gen_version_file:
>  ifneq ($(STORED_VERSION_STRING),$(VERSION_STRING))
>  	$(info updating $(VERSION_FILE) to $(VERSION_STRING))
>  	@echo \#define VERSION_STRING \"$(VERSION_STRING)\" >$(VERSION_FILE)
>  endif
>  
> -$(NAME): gen_version_file $(OBJS) $(MSGOBJS) $(INFOPLIST)
> +$(NAME): $(OBJS) $(MSGOBJS) $(INFOPLIST)
>  	$(CC) $(LDFLAGS) -o $(NAME) $(OBJS) $(LIBS)
>  
>  install: $(NAME)
> -- 
> 1.8.1.4
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

-- 
Dirk Hohndel
Intel Open Source Technology Center


More information about the subsurface mailing list