Better abstraction of C compiler by using the $(CC) Make variable

This commit is contained in:
Paul LeoNerd Evans 2014-01-06 17:55:58 +00:00
parent 4fd397af2c
commit 11e6cf7497
1 changed files with 8 additions and 8 deletions

View File

@ -60,28 +60,28 @@ MAN7DIR=$(MANDIR)/man7
all: $(LIBRARY) $(DEMOS) all: $(LIBRARY) $(DEMOS)
%.lo: %.c termkey.h termkey-internal.h %.lo: %.c termkey.h termkey-internal.h
$(LIBTOOL) --mode=compile --tag=CC cc $(CFLAGS) -o $@ -c $< $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -o $@ -c $<
$(LIBRARY): $(OBJECTS) $(LIBRARY): $(OBJECTS)
$(LIBTOOL) --mode=link --tag=CC cc -rpath $(LIBDIR) -version-info $(VERSION_CURRENT):$(VERSION_REVISION):$(VERSION_AGE) $(LDFLAGS) -o $@ $^ $(LIBTOOL) --mode=link --tag=CC $(CC) -rpath $(LIBDIR) -version-info $(VERSION_CURRENT):$(VERSION_REVISION):$(VERSION_AGE) $(LDFLAGS) -o $@ $^
demo: $(LIBRARY) demo.lo demo: $(LIBRARY) demo.lo
$(LIBTOOL) --mode=link --tag=CC cc -o $@ $^ $(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^
demo-async: $(LIBRARY) demo-async.lo demo-async: $(LIBRARY) demo-async.lo
$(LIBTOOL) --mode=link --tag=CC cc -o $@ $^ $(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^
demo-glib.lo: demo-glib.c termkey.h demo-glib.lo: demo-glib.c termkey.h
$(LIBTOOL) --mode=compile --tag=CC cc -o $@ -c $< $(shell pkg-config glib-2.0 --cflags) $(LIBTOOL) --mode=compile --tag=CC $(CC) -o $@ -c $< $(shell pkg-config glib-2.0 --cflags)
demo-glib: $(LIBRARY) demo-glib.lo demo-glib: $(LIBRARY) demo-glib.lo
$(LIBTOOL) --mode=link --tag=CC cc -o $@ $^ $(shell pkg-config glib-2.0 --libs) $(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^ $(shell pkg-config glib-2.0 --libs)
t/%.t: t/%.c $(LIBRARY) t/taplib.lo t/%.t: t/%.c $(LIBRARY) t/taplib.lo
$(LIBTOOL) --mode=link --tag=CC cc -o $@ $^ $(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^
t/taplib.lo: t/taplib.c t/taplib.lo: t/taplib.c
$(LIBTOOL) --mode=compile --tag=CC cc $(CFLAGS) -o $@ -c $^ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -o $@ -c $^
.PHONY: test .PHONY: test
test: $(TESTFILES) test: $(TESTFILES)