0
votes

I'm trying to compile a program using GNU Autotools. In my configure.ac I have the following line:

PKG_CHECK_MODULES([DEPS], [cairo], [], [AC_MSG_ERROR([Missing Cairo library])])

My src/Makefile.am looks like this:

bin_PROGRAMS = main
main_SOURCES = main.cpp window.cpp window.h button.cpp button.h
main_CFLAGS = $(DEPS_CFLAGS)
main_LDFLAGS = $(DEPS_LIBS)

In my Makefile, I've echoed $(DEPS_CFLAGS) and $(DEPS_LIBS) to confirm they have the correct values.

However, compiling fails, saying that it couldn't find a header file that should be in CFLAGS:

g++ -DPACKAGE_NAME=\"toolkit\" -DPACKAGE_TARNAME=\"toolkit\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"toolkit\ 0.0.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"toolkit\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE__BOOL=1 -I.     -g -O2 -MT button.o -MD -MP -MF .deps/button.Tpo -c -o button.o button.cpp
button.cpp:4:23: fatal error: cairo-xcb.h: No such file or directory
 #include <cairo-xcb.h>
                       ^
compilation terminated.
make[1]: *** [button.o] Error 1
make[1]: Leaving directory `/mnt/ubuntu/home/gulshan/code/x11/toolkit/src'
make: *** [all-recursive] Error 1

This looks like the target that generated that error. You can see it doesn't mention anything about CFLAGS:

.cpp.o:
    $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
    $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
#   $(AM_V_CXX)source='$<' object='$@' libtool=no \
#   DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
#   $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ $<

What am I doing wrong? Here is the entire Makefile. You can see that main_CFLAGS and main_LDFLAGS are not even used.

# Makefile.in generated by automake 1.14 from Makefile.am.
# src/Makefile.  Generated from Makefile.in by configure.

# Copyright (C) 1994-2013 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.




am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
  case $${target_option-} in \
      ?) ;; \
      *) echo "am__make_running_with_option: internal error: invalid" \
              "target option '$${target_option-}' specified" >&2; \
         exit 1;; \
  esac; \
  has_opt=no; \
  sane_makeflags=$$MAKEFLAGS; \
  if $(am__is_gnu_make); then \
    sane_makeflags=$$MFLAGS; \
  else \
    case $$MAKEFLAGS in \
      *\\[\ \   ]*) \
        bs=\\; \
        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
          | sed "s/$$bs$$bs[$$bs $$bs   ]*//g"`;; \
    esac; \
  fi; \
  skip_next=no; \
  strip_trailopt () \
  { \
    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
  }; \
  for flg in $$sane_makeflags; do \
    test $$skip_next = yes && { skip_next=no; continue; }; \
    case $$flg in \
      *=*|--*) continue;; \
        -*I) strip_trailopt 'I'; skip_next=yes;; \
      -*I?*) strip_trailopt 'I';; \
        -*O) strip_trailopt 'O'; skip_next=yes;; \
      -*O?*) strip_trailopt 'O';; \
        -*l) strip_trailopt 'l'; skip_next=yes;; \
      -*l?*) strip_trailopt 'l';; \
      -[dEDm]) skip_next=yes;; \
      -[JT]) skip_next=yes;; \
    esac; \
    case $$flg in \
      *$$target_option*) has_opt=yes; break;; \
    esac; \
  done; \
  test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/toolkit
pkgincludedir = $(includedir)/toolkit
pkglibdir = $(libdir)/toolkit
pkglibexecdir = $(libexecdir)/toolkit
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = main$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
    $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    $(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_main_OBJECTS = main.$(OBJEXT) window.$(OBJEXT) button.$(OBJEXT)
main_OBJECTS = $(am_main_OBJECTS)
main_LDADD = $(LDADD)
main_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(main_LDFLAGS) \
    $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo "  GEN     " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_$(V))
am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY))
am__v_CXX_0 = @echo "  CXX     " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
    -o $@
AM_V_CXXLD = $(am__v_CXXLD_$(V))
am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
am__v_CXXLD_0 = @echo "  CXXLD   " $@;
am__v_CXXLD_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_$(V))
am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
am__v_CC_0 = @echo "  CC      " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_$(V))
am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
am__v_CCLD_0 = @echo "  CCLD    " $@;
am__v_CCLD_1 =
SOURCES = $(main_SOURCES)
DIST_SOURCES = $(main_SOURCES)
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates.  Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
  BEGIN { nonempty = 0; } \
  { items[$$0] = 1; nonempty = 1; } \
  END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique.  This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
  list='$(am__tagged_files)'; \
  unique=`for i in $$list; do \
    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /home/gulshan/code/x11/toolkit/missing aclocal-1.14
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AUTOCONF = ${SHELL} /home/gulshan/code/x11/toolkit/missing autoconf
AUTOHEADER = ${SHELL} /home/gulshan/code/x11/toolkit/missing autoheader
AUTOMAKE = ${SHELL} /home/gulshan/code/x11/toolkit/missing automake-1.14
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CXX = g++
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DPACKAGE_NAME=\"toolkit\" -DPACKAGE_TARNAME=\"toolkit\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"toolkit\ 0.0.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"toolkit\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE__BOOL=1
DEPDIR = .deps
DEPS_CFLAGS = -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16
DEPS_LIBS = -lcairo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /usr/bin/grep -E
EXEEXT =
GREP = /usr/bin/grep
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LDFLAGS =
LIBOBJS =
LIBS =
LTLIBOBJS =
MAKEINFO = ${SHELL} /home/gulshan/code/x11/toolkit/missing makeinfo
MKDIR_P = /usr/bin/mkdir -p
OBJEXT = o
PACKAGE = toolkit
PACKAGE_BUGREPORT = [email protected]
PACKAGE_NAME = toolkit
PACKAGE_STRING = toolkit 0.0.1
PACKAGE_TARNAME = toolkit
PACKAGE_URL =
PACKAGE_VERSION = 0.0.1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
PKG_CONFIG_PATH =
SET_MAKE =
SHELL = /bin/sh
STRIP =
VERSION = 0.0.1
abs_builddir = /home/gulshan/code/x11/toolkit/src
abs_srcdir = /home/gulshan/code/x11/toolkit/src
abs_top_builddir = /home/gulshan/code/x11/toolkit
abs_top_srcdir = /home/gulshan/code/x11/toolkit
ac_ct_CC = gcc
ac_ct_CXX = g++
am__include = include
am__leading_dot = .
am__quote =
am__tar = $${TAR-tar} chof - "$$tardir"
am__untar = $${TAR-tar} xf -
bindir = ${exec_prefix}/bin
build_alias =
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host_alias =
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/gulshan/code/x11/toolkit/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
main_SOURCES = main.cpp window.cpp window.h button.cpp button.h
main_CFLAGS = ${DEPS_CPPFLAGS}
main_LDFLAGS = $(DEPS_LIBS)
all: all-am

.SUFFIXES:
.SUFFIXES: .cpp .o .obj
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
    @for dep in $?; do \
      case '$(am__configure_deps)' in \
        *$$dep*) \
          ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
            && { if test -f $@; then exit 0; else break; fi; }; \
          exit 1;; \
      esac; \
    done; \
    echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
    $(am__cd) $(top_srcdir) && \
      $(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
    @case '$?' in \
      *config.status*) \
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
      *) \
        echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure:  $(am__configure_deps)
    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
    @$(NORMAL_INSTALL)
    @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
    if test -n "$$list"; then \
      echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
      $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
    fi; \
    for p in $$list; do echo "$$p $$p"; done | \
    sed 's/$(EXEEXT)$$//' | \
    while read p p1; do if test -f $$p \
      ; then echo "$$p"; echo "$$p"; else :; fi; \
    done | \
    sed -e 'p;s,.*/,,;n;h' \
        -e 's|.*|.|' \
        -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
    sed 'N;N;N;s,\n, ,g' | \
    $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
      { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
        if ($$2 == $$4) files[d] = files[d] " " $$1; \
        else { print "f", $$3 "/" $$4, $$1; } } \
      END { for (d in files) print "f", d, files[d] }' | \
    while read type dir files; do \
        if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
        test -z "$$files" || { \
          echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
          $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
        } \
    ; done

uninstall-binPROGRAMS:
    @$(NORMAL_UNINSTALL)
    @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
    files=`for p in $$list; do echo "$$p"; done | \
      sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
          -e 's/$$/$(EXEEXT)/' \
    `; \
    test -n "$$list" || exit 0; \
    echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
    cd "$(DESTDIR)$(bindir)" && rm -f $$files

clean-binPROGRAMS:
    -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)

main$(EXEEXT): $(main_OBJECTS) $(main_DEPENDENCIES) $(EXTRA_main_DEPENDENCIES)
    @rm -f main$(EXEEXT)
    $(AM_V_CXXLD)$(main_LINK) $(main_OBJECTS) $(main_LDADD) $(LIBS)

mostlyclean-compile:
    -rm -f *.$(OBJEXT)

distclean-compile:
    -rm -f *.tab.c

include ./$(DEPDIR)/button.Po
include ./$(DEPDIR)/main.Po
include ./$(DEPDIR)/window.Po

.cpp.o:
    $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
    $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
#   $(AM_V_CXX)source='$<' object='$@' libtool=no \
#   DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
#   $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ $<

.cpp.obj:
    $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
    $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
#   $(AM_V_CXX)source='$<' object='$@' libtool=no \
#   DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
#   $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`

ID: $(am__tagged_files)
    $(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags

tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
    set x; \
    here=`pwd`; \
    $(am__define_uniq_tagged_files); \
    shift; \
    if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
      test -n "$$unique" || unique=$$empty_fix; \
      if test $$# -gt 0; then \
        $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          "$$@" $$unique; \
      else \
        $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
          $$unique; \
      fi; \
    fi
ctags: ctags-am

CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
    $(am__define_uniq_tagged_files); \
    test -z "$(CTAGS_ARGS)$$unique" \
      || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
         $$unique

GTAGS:
    here=`$(am__cd) $(top_builddir) && pwd` \
      && $(am__cd) $(top_srcdir) \
      && gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am

cscopelist-am: $(am__tagged_files)
    list='$(am__tagged_files)'; \
    case "$(srcdir)" in \
      [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
      *) sdir=$(subdir)/$(srcdir) ;; \
    esac; \
    for i in $$list; do \
      if test -f "$$i"; then \
        echo "$(subdir)/$$i"; \
      else \
        echo "$$sdir/$$i"; \
      fi; \
    done >> $(top_builddir)/cscope.files

distclean-tags:
    -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
    @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
    topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
    list='$(DISTFILES)'; \
      dist_files=`for file in $$list; do echo $$file; done | \
      sed -e "s|^$$srcdirstrip/||;t" \
          -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
    case $$dist_files in \
      */*) $(MKDIR_P) `echo "$$dist_files" | \
               sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
               sort -u` ;; \
    esac; \
    for file in $$dist_files; do \
      if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
      if test -d $$d/$$file; then \
        dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
        if test -d "$(distdir)/$$file"; then \
          find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
        fi; \
        if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
          cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
          find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
        fi; \
        cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
      else \
        test -f "$(distdir)/$$file" \
        || cp -p $$d/$$file "$(distdir)/$$file" \
        || exit 1; \
      fi; \
    done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
    for dir in "$(DESTDIR)$(bindir)"; do \
      test -z "$$dir" || $(MKDIR_P) "$$dir"; \
    done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
    @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
    if test -z '$(STRIP)'; then \
      $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
        install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
          install; \
    else \
      $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
        install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
        "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
    fi
mostlyclean-generic:

clean-generic:

distclean-generic:
    -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
    -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
    @echo "This command is intended for maintainers to use"
    @echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-binPROGRAMS clean-generic mostlyclean-am

distclean: distclean-am
    -rm -rf ./$(DEPDIR)
    -rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
    distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am:

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am: install-binPROGRAMS

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

install-pdf: install-pdf-am

install-pdf-am:

install-ps: install-ps-am

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-am
    -rm -rf ./$(DEPDIR)
    -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-binPROGRAMS

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
    clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
    distclean distclean-compile distclean-generic distclean-tags \
    distdir dvi dvi-am html html-am info info-am install \
    install-am install-binPROGRAMS install-data install-data-am \
    install-dvi install-dvi-am install-exec install-exec-am \
    install-html install-html-am install-info install-info-am \
    install-man install-pdf install-pdf-am install-ps \
    install-ps-am install-strip installcheck installcheck-am \
    installdirs maintainer-clean maintainer-clean-generic \
    mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
    ps ps-am tags tags-am uninstall uninstall-am \
    uninstall-binPROGRAMS


# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
1

1 Answers

2
votes

This looks like the target that generated that error. You can see it doesn't mention anything about CFLAGS:

Right. You are using the C++ compiler, not the C compiler:

main_SOURCES = main.cpp window.cpp window.h button.cpp button.h

Something like:

main_CXXFLAGS = $(DEPS_CFLAGS)

might be enough to get past your compilation error.