Permalink
Browse files

[Makefile] Fix the builddate dependency

Since builddate is erased after each succesfull build
even a make install will rebuild omapconf whereas it should
just install it.

Make builddate.c dependent of all the objects. It will then ensure
that builddate will be updated each time a object is newer.

Remove as well the useless targets to "all" target.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Patrick Titiano <p-titiano@ti.com>
  • Loading branch information...
1 parent 2c94302 commit 01952c9bb56ec8892710ace92f228afcf86590a3 @bcousson bcousson committed with Patrick Titiano Jan 21, 2013
Showing with 8 additions and 9 deletions.
  1. +8 −9 Makefile
View
17 Makefile
@@ -219,7 +219,6 @@ OMAP5OBJECTS= $(OMAP5SOURCES:.c=.o)
SOURCES=\
omapconf.c\
- builddate.c\
common/lib.c\
common/reg.c\
common/autoadjust_table.c\
@@ -284,14 +283,14 @@ EXECUTABLE= omapconf
-all: $(SOURCES) $(ALLOBJECTS) $(EXECUTABLE)
+all: $(EXECUTABLE)
-$(EXECUTABLE): $(ALLOBJECTS)
- $(CC) $(STATIC_BUILD) $(LDFLAGS) $(ALLOBJECTS) -lrt -o $@
- rm -f builddate.c
+$(EXECUTABLE): $(ALLOBJECTS) builddate.o
+ $(CC) $(STATIC_BUILD) $(LDFLAGS) $(ALLOBJECTS) builddate.o \
+ -lrt -o $@
@@ -302,28 +301,28 @@ $(EXECUTABLE): $(ALLOBJECTS)
-builddate.c:
+builddate.c: $(ALLOBJECTS)
echo 'char *builddate="'`date`'";' > builddate.c
-install: omapconf
+install: $(EXECUTABLE)
install -d $(DESTDIR)
install omapconf $(DESTDIR)
-install_android: omapconf
+install_android: $(EXECUTABLE)
adb push omapconf /data/
clean:
- rm -f omapconf *.o builddate.c
+ rm -f $(EXECUTABLE) *.o builddate.c
rm -f $(OBJECTS)
rm -f $(LINUXOBJECTS)
rm -f $(OMAPOBJECTS)

0 comments on commit 01952c9

Please sign in to comment.