Skip to content

Commit

Permalink
OTHER: Clean up object files after successful make. Use correct CFLAGS.
Browse files Browse the repository at this point in the history
  • Loading branch information
dchokola committed Dec 6, 2018
1 parent acdc892 commit 521957b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions c/Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 521957b

Please sign in to comment.