Просмотр исходного кода

Patch from Hans Feldt
This small patch (against r948) adds variable CPPFLAGS to all make rules
that compiles `.c' files into `.o' files.

This makes it possible to set CPPFLAGS on the command line as in:

$ make CPPFLAGS=-DAMFDEBUG

Editing the makefile when prototyping is then not needed.

Another reason is that some of the openais C files are built using the
implicit rule for C files (which uses CPPFLAGS). The change makes rules
consistent with the implicit rule.

It also adds a few missing files to the clean make target.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@950 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 лет назад
Родитель
Сommit
b855d18145
4 измененных файлов с 34 добавлено и 30 удалено
  1. 22 22
      exec/Makefile
  2. 5 3
      lcr/Makefile
  3. 2 2
      lib/Makefile
  4. 5 3
      test/Makefile

+ 22 - 22
exec/Makefile

@@ -173,73 +173,73 @@ clean:
 	rm -f aisexec $(OBJS) *.o *.lcrso libtotem_pg.so.1.0 libtotem_pg.so.1 libtotem_pg.so libtotem_pg.a gmon.out keygen keygen.o openais-instantiate *.da *.bb *.bbg
 
 depend:
-	makedepend -Y -- $(CFLAGS) $(EXEC_SRC) $(TOTEM_SRC) > /dev/null 2>&1
+	makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(EXEC_SRC) $(TOTEM_SRC) > /dev/null 2>&1
 
 # - fPIC rules required for service handler shared objects
 ../lcr/lcr_ifact.o: ../lcr/lcr_ifact.c
-	$(CC) $(CFLAGS) -I../lcr -c -o $@ ../lcr/lcr_ifact.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -I../lcr -c -o $@ ../lcr/lcr_ifact.c
 
 evs.o: evs.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 clm.o: clm.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 amf.o: amf.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 ckpt.o: ckpt.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 evt.o: evt.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 lck.o: lck.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 msg.o: msg.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 cfg.o: cfg.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 cpg.o: cpg.c
-	$(CC) $(CFLAGS) -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c
 
 
 # -fPIC rules required for lib totem
 aispoll.o: aispoll.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 totempg.o: totempg.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 totemsrp.o: totemsrp.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 totemrrp.o: totemrrp.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 totemip.o: totemip.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 totemnet.o: totemnet.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 wthread.o: wthread.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 tlist.o: tlist.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 crypto.o: crypto.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 totemmrp.o: totemmrp.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 totemconfig.o: totemconfig.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 # DO NOT DELETE
 

+ 5 - 3
lcr/Makefile

@@ -66,10 +66,12 @@ uic: uic.o
 	$(CC) $(LDFLAGS) uic.o -o uic
 
 libtest_a.o: libtest_a.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 libtest_b.o: libtest_b.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 clean:
-	rm -f test libtest.so* *.o uic liblcr.so* liblcr.a *.lcrso *.da *.ba *.bb *.bbg
+	rm -f test libtest.so* *.o uic liblcr.so* liblcr.a *.lcrso *.da *.ba *.bb *.bbg \
+	test_static
+

+ 2 - 2
lib/Makefile

@@ -193,10 +193,10 @@ clean:
  
 # -fPIC rules required for all libraries
 %.o: %.c
-	$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $(*F).c
 
 depend:
-	makedepend -Y -- $(CFLAGS) $(LIBAIS_SRC) > /dev/null 2>&1
+	makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(LIBAIS_SRC) > /dev/null 2>&1
 # DO NOT DELETE
 
 util.o: ../include/saAis.h ../include/ipc_gen.h ../exec/totemip.h util.h

+ 5 - 3
test/Makefile

@@ -142,12 +142,14 @@ clean:
 	rm -f *.o testclm testamf testamf1 testamf2 testamf3 testamf4 \
 	testamf5 testamf6 testamfth testckpt ckptstress testtimer \
 	ckptbench ckptbenchth testevt testevs ckpt-wr ckpt-rd \
-	evsbench subscription publish evtbench unlink testmsg testcpg
+	evsbench subscription publish evtbench unlink testmsg testcpg \
+	testclm2 testlck
+
 %.o: %.c
-	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
 
 depend:
-	makedepend -Y -- $(CFLAGS) $(TEST_SRC) > /dev/null 2>&1
+	makedepend -Y -- $(CFLAGS) $(CPPFLAGS) $(TEST_SRC) > /dev/null 2>&1
 # DO NOT DELETE
 
 testclm.o: ../include/saAis.h ../include/saClm.h