From ad9b12a158bd99d816ecaf7c67d09f9986eeb28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 8 Oct 2016 14:09:00 +0200 Subject: [PATCH 2/2] Makefile: Enforce CC tag for libtool Fixes #4. --- Makefile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 423eeaa..8099403 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,10 @@ LIBDIR ?= $(PREFIX)/lib FONTSPATH ?= /usr/share/fonts MONOFONTPATH != find ${FONTSPATH} -name LiberationMono-Regular.ttf -print -quit + CC ?= gcc CFLAGS += -Wall -Wextra -Werror -pedantic --std=gnu99 -g -DMONOFONTPATH=\"$(MONOFONTPATH)\" +LIBTOOL = libtool --tag=CC SDL := `sdl-config --libs` -lSDL_ttf SDLFLAGS := `sdl-config --cflags` OBJS := atg.o plumbing.o w_box.o w_label.o w_image.o w_button.o w_spinner.o w_toggle.o w_filepicker.o @@ -22,37 +24,37 @@ endif all: libatg.la test widget install: libatg.la - libtool --mode=install install -D -m0644 atg.h $(DESTDIR)$(INCDIR)/atg.h - libtool --mode=install install -D -m0644 atg_internals.h $(DESTDIR)$(INCDIR)/atg_internals.h - libtool --mode=install install -D -m0644 libatg.la $(DESTDIR)$(LIBDIR)/libatg.la + $(LIBTOOL) --mode=install install -D -m0644 atg.h $(DESTDIR)$(INCDIR)/atg.h + $(LIBTOOL) --mode=install install -D -m0644 atg_internals.h $(DESTDIR)$(INCDIR)/atg_internals.h + $(LIBTOOL) --mode=install install -D -m0644 libatg.la $(DESTDIR)$(LIBDIR)/libatg.la -ldconfig uninstall: - libtool --mode=uninstall /bin/rm -f $(DESTDIR)$(LIBDIR)/libatg.la $(DESTDIR)$(INCDIR)/atg.h $(DESTDIR)$(INCDIR)/atg_internals.h + $(LIBTOOL) --mode=uninstall /bin/rm -f $(DESTDIR)$(LIBDIR)/libatg.la $(DESTDIR)$(INCDIR)/atg.h $(DESTDIR)$(INCDIR)/atg_internals.h clean: rm -f libatg.la $(LOBJS) test widget test: test.c atg.h libatg.la - libtool --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) test.c $(LDFLAGS) -o test -latg $(SDL) + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) test.c $(LDFLAGS) -o test -latg $(SDL) widget: widget.c libatg.la atg.h atg_internals.h - libtool --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) widget.c $(LDFLAGS) -o widget -latg $(SDL) + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) widget.c $(LDFLAGS) -o widget -latg $(SDL) libatg.la: $(LOBJS) - libtool --mode=link $(CC) -o $@ $(LOBJS) -rpath $(DESTDIR)$(LIBDIR) -version-info $(LVERSION) + $(LIBTOOL) --mode=link $(CC) -o $@ $(LOBJS) -rpath $(DESTDIR)$(LIBDIR) -version-info $(LVERSION) atg.lo: atg.c $(INCLUDES) - libtool --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) -c $< + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) -c $< plumbing.lo: plumbing.c $(INCLUDES) - libtool --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) -c $< + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) -c $< w_%.lo: w_%.c $(INCLUDES) - libtool --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) -c $< + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) -c $< %.lo: %.c %.h - libtool --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< w32: rm -rf libatg-w32 -- 2.10.1