[PATCH 5/6] repair order of rules for clarity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Plus minor simplifications while at it

Signed-off-by: aldot <rep.dot.nop@xxxxxxxxx>
---
 src/Makefile.in |   34 ++++++++++++++--------------------
 1 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/src/Makefile.in b/src/Makefile.in
index ccb61c1..2b15d7c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -63,9 +63,6 @@ PROG = $(POBJ:.o=)
 SRCS = $(GSRC) $(LSRC) $(PSRC)
 SRCSP= $(SRCS:.c=.P) lib/libcurses.P
 OBJECTS = $(GOBJ) $(filter-out @CURSES_OBJS@,$(LOBJ)) $(POBJ)
-# All objects depend on their respective sources
-$(OBJECTS) @CURSES_OBJS@: %.o: $(srcdir)/%.c
-$(PICS): %.lo: $(srcdir)/%.c
 
 DEFS  = @DEFS@
 
@@ -74,9 +71,6 @@ STRIP = -s
 ### REAL TARGETS
 all:	gpm lib/@SHLIB@ lib/libgpm.a $(PROG)
 
-gpm:	$(GOBJ)
-	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm
-
 ### BUILD PROCESS
 
 # allow CFLAGS to be overriden from make command line
@@ -84,18 +78,9 @@ gpm:	$(GOBJ)
 # makefile standards are at cross-purposes: CFLAGS is reserved for
 # user-overridable flags, but it's also all the implicit rule looks at.
 
-# the prog rules are not very clean...
-prog/%.o: $(srcdir)/prog/%.c
-	@@MKDIR_P@ $(@D)
-	$(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $<
-
-prog/%:	prog/%.o
-	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS)
-
-
 #Make sure that our output-dir exists. autotools would have done this
 #for us for SUBDIRS, but we do not use them here (why, btw?)
-%.o:
+$(OBJECTS) @CURSES_OBJS@: %.o: $(srcdir)/%.c
 	@@MKDIR_P@ $(@D)
 	$(CC) -MD @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $<
 	@cp $*.d $*.P; \
@@ -103,13 +88,22 @@ prog/%:	prog/%.o
      	 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
 	#rm -f $*.d
 
-%.lo:
+$(PICS): %.lo: $(srcdir)/%.c
 	@@MKDIR_P@ $(@D)
 	$(CC) @CPPFLAGS@ $(CPPFLAGS) @PICFLAGS@ @CFLAGS@ $(CFLAGS) -c -o $@ $<
 
-%:	%.o
+# the prog rules are not very clean...
+prog/%.o: $(srcdir)/prog/%.c
+	@@MKDIR_P@ $(@D)
+	$(CC) @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@ $<
+
+prog/%:	prog/%.o
 	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS)
 
+gpm:	$(GOBJ)
+	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm
+
+
 ### GENERATED INCLUDES
 
 $(OBJECTS): headers/drivers.h
@@ -172,8 +166,8 @@ prog/gpm-root: prog/gpm-root.c lib/libgpm.so
 	$(CC) -I. @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS) -c -o $@.o $<
 	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $@.o @LIBS@ $(LIBS) lib/libgpm.so
 
-prog/mouse-test: prog/mouse-test.o mice.o prog/open_console.o  \
-						$(GSRC:.c=.o)
+prog/mouse-test: prog/mouse-test.o mice.o prog/open_console.o \
+		$(GCOMMON:.c=.o) $(GDRIVERS:.c=.o)
 	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $^ @LIBS@ $(LIBS) -lm
 
 $(PROG):	lib/libgpm.so
-- 
1.5.5

_______________________________________________
gpm mailing list
gpm@xxxxxxxxxxxxxx
http://lists.linux.it/listinfo/gpm

[Index of Archives]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Gimp]     [Yosemite News]