From 521957bbfc94d1ec73488c85ed5ca83e08aa7d92 Mon Sep 17 00:00:00 2001 From: "Daniel P. Chokola" Date: Wed, 5 Dec 2018 20:09:49 -0500 Subject: [PATCH] OTHER: Clean up object files after successful make. Use correct CFLAGS. --- c/Makefile | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/c/Makefile b/c/Makefile index c3c37bc..ba350d2 100644 --- a/c/Makefile +++ b/c/Makefile @@ -1,23 +1,24 @@ -LIBS=`pkg-config --libs xmms2-client` -GLIB=`pkg-config --libs xmms2-client-glib` `pkg-config --libs glib-2.0` +CFLAGS_XMMS2=`pkg-config --cflags xmms2-client` +CFLAGS_GLIB=`pkg-config --cflags glib-2.0` +LIBS_XMMS2=`pkg-config --libs xmms2-client` +LIBS_GLIB=`pkg-config --libs xmms2-client-glib` `pkg-config --libs glib-2.0` -all: tut1 tut2 tut3 tut4 tut5 tut6 tut7 tut8 +all: xmms2 xmms2glib + +xmms2: CFLAGS=$(CFLAGS_XMMS2) +xmms2: LIBS=$(LIBS_XMMS2) +xmms2: tut1 tut2 tut3 tut4 tut5 + +xmms2glib: CFLAGS=$(CFLAGS_XMMS2) $(CFLAGS_GLIB) +xmms2glib: LIBS=$(LIBS_XMMS2) $(LIBS_GLIB) +xmms2glib: tut6 tut7 tut8 %.o: %.c - gcc `pkg-config --cflags xmms2-client glib-2.0` -Wall -c -o $@ $< + gcc $(CFLAGS) -Wall -c -o $@ $< tut%: tut%.o gcc -o $@ $< $(LIBS) -tut6: tut6.o - gcc -o $@ $< $(LIBS) $(GLIB) - -tut7: tut7.o - gcc -o $@ $< $(LIBS) $(GLIB) - -tut8: tut8.o - gcc -o $@ $< $(LIBS) $(GLIB) - clean: rm -f tut? *.o