autotools: how to deal with a source generated by configure? - build

Let's imagine a minimal project with the following structure:
|-- configure.ac
|-- Makefile.am
|-- src/
`-- ...
|-- test/
`-- Makefile.am
`-- test.sh
`-- test.py.in
Now, test.py.in uses autotools variables to build test.py. Running configure does build test.py and I'm quite happy about it.
But, touching/modifying test.py.in and then running make check should run configure before actually testing, but it does not. How to?
My Makefile.am:
check_SCRIPTS = \
test.sh \
$(NULL)
check_PROGRAMS = \
$(NULL)
testsuite_bin_SOURCES = \
$(NULL)
TESTS = \
test.sh \
$(NULL)
MOSTLYCLEANFILES = \
*.out *.err *.log \
$(NULL)
EXTRA_DIST = \
test.sh \
test.py \
$(NULL)
Running make check when test.py has been rmed:
$ make check
make test.sh
make[1]: Entering directory `.../test'
make[1]: Nothing to be done for `test.sh'.
make[1]: Leaving directory `.../test'
make check-TESTS
make[1]: Entering directory `.../test'
*** './test.py' was not found - aborting test ***
FAIL: test.sh
=======================================
1 of 1 test failed
Please report to nobody#nohost.nodomain
=======================================
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory `/test
make: *** [check-am] Error 2
Part of my configure.ac:
AC_CONFIG_FILES([
#...
test/Makefile
test/test.py
])
AC_OUTPUT

Related

Makefile error when building Veins project with Omnet++

I've built a number of projects with Veins on Omnet++ without issues at this stage, and I decided to implement CAM messages into a simulation. However, upon building I arrive at the following error:
12:41:23 **** Incremental Build of configuration release for project v2x ****
make MODE=release all
cd src && make make[1]: Entering directory '/home/veins/workspace.omnetpp/v2x/src'
Creating executable: ../out/clang-release/src/v2x /usr/bin/ld: cannot open output file ../out/clang-release/src/v2x: Is a directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]:
*** [Makefile:117: ../out/clang-release/src/v2x] Error 1 make[1]: Leaving directory '/home/veins/workspace.omnetpp/v2x/src'
make: *** [Makefile:2: all]
Error 2 "make MODE=release all" terminated with exit code 2.
Build might be incomplete.
12:41:24 Build Failed. 3 errors, 0 warnings. (took 549ms)
My Makefile reads:
#
# OMNeT++/OMNEST Makefile for v2x
#
# This file was generated with the command:
# opp_makemake -f --deep -KINET_PROJ=/home/veins/src/inet -KLTE_PROJ=/home/veins/src/simulte -KVEINS_INET_PROJ=/home/veins/src/veins/subprojects/veins_inet -KVEINS_PROJ=/home/veins/src/veins -DINET_IMPORT -DVEINS_IMPORT -DVEINS_INET_IMPORT -I$$\(INET_PROJ\)/src -I$$\(LTE_PROJ\)/src -I$$\(VEINS_INET_PROJ\)/src -I$$\(VEINS_PROJ\)/src -I. -L$$\(INET_PROJ\)/src -L$$\(LTE_PROJ\)/src -L$$\(VEINS_PROJ\)/src -L$$\(VEINS_INET_PROJ\)/src -lINET$$\(D\) -llte$$\(D\) -lveins$$\(D\) -lveins_inet$$\(D\)
#
# Name of target to be created (-o option)
TARGET_DIR = .
TARGET_NAME = v2x$(D)
TARGET = $(TARGET_NAME)$(EXE_SUFFIX)
TARGET_IMPLIB = $(TARGET_NAME)$(IMPLIB_SUFFIX)
TARGET_IMPDEF = $(TARGET_NAME)$(IMPDEF_SUFFIX)
TARGET_FILES = $(TARGET_DIR)/$(TARGET)
# User interface (uncomment one) (-u option)
USERIF_LIBS = $(ALL_ENV_LIBS) # that is, $(TKENV_LIBS) $(QTENV_LIBS) $(CMDENV_LIBS)
#USERIF_LIBS = $(CMDENV_LIBS)
#USERIF_LIBS = $(TKENV_LIBS)
#USERIF_LIBS = $(QTENV_LIBS)
# C++ include paths (with -I)
INCLUDE_PATH = -I$(INET_PROJ)/src -I$(LTE_PROJ)/src -I$(VEINS_INET_PROJ)/src -I$(VEINS_PROJ)/src -I.
# Additional object and library files to link with
EXTRA_OBJS =
# Additional libraries (-L, -l options)
LIBS = $(LDFLAG_LIBPATH)$(INET_PROJ)/src $(LDFLAG_LIBPATH)$(LTE_PROJ)/src $(LDFLAG_LIBPATH)$(VEINS_PROJ)/src $(LDFLAG_LIBPATH)$(VEINS_INET_PROJ)/src -lINET$(D) -llte$(D) -lveins$(D) -lveins_inet$(D)
# Output directory
PROJECT_OUTPUT_DIR = ../out
PROJECTRELATIVE_PATH = src
O = $(PROJECT_OUTPUT_DIR)/$(CONFIGNAME)/$(PROJECTRELATIVE_PATH)
# Object files for local .cc, .msg and .sm files
OBJS = \
$O/v2x/GeneralMessageSerializer.o \
$O/v2x/VeinsInetApplicationBase.o \
$O/v2x/VeinsInetManager.o \
$O/v2x/VeinsInetManagerBase.o \
$O/v2x/VeinsInetManagerForker.o \
$O/v2x/VeinsInetMobility.o \
$O/v2x/VeinsInetSampleApplication.o \
$O/v2x/VeinsInetSampleMessageSerializer.o \
$O/v2x/GeneralMessage_m.o \
$O/v2x/VeinsInetSampleMessage_m.o
# Message files
MSGFILES = \
v2x/GeneralMessage.msg \
v2x/VeinsInetSampleMessage.msg
# SM files
SMFILES =
# Other makefile variables (-K)
INET_PROJ=/home/veins/src/inet
LTE_PROJ=/home/veins/src/simulte
VEINS_INET_PROJ=/home/veins/src/veins/subprojects/veins_inet
VEINS_PROJ=/home/veins/src/veins
#------------------------------------------------------------------------------
# Pull in OMNeT++ configuration (Makefile.inc)
ifneq ("$(OMNETPP_CONFIGFILE)","")
CONFIGFILE = $(OMNETPP_CONFIGFILE)
else
CONFIGFILE = $(shell opp_configfilepath)
endif
ifeq ("$(wildcard $(CONFIGFILE))","")
$(error Config file '$(CONFIGFILE)' does not exist -- add the OMNeT++ bin directory to the path so that opp_configfilepath can be found, or set the OMNETPP_CONFIGFILE variable to point to Makefile.inc)
endif
include $(CONFIGFILE)
# Simulation kernel and user interface libraries
OMNETPP_LIBS = $(OPPMAIN_LIB) $(USERIF_LIBS) $(KERNEL_LIBS) $(SYS_LIBS)
ifneq ($(PLATFORM),win32.x86_64)
LIBS += -Wl,-rpath,$(abspath $(INET_PROJ)/src) -Wl,-rpath,$(abspath $(LTE_PROJ)/src) -Wl,-rpath,$(abspath $(VEINS_PROJ)/src) -Wl,-rpath,$(abspath $(VEINS_INET_PROJ)/src)
endif
COPTS = $(CFLAGS) $(IMPORT_DEFINES) -DINET_IMPORT -DVEINS_IMPORT -DVEINS_INET_IMPORT $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)
MSGCOPTS = $(INCLUDE_PATH)
SMCOPTS =
# we want to recompile everything if COPTS changes,
# so we store COPTS into $COPTS_FILE (if COPTS has changed since last build)
# and make the object files depend on it
COPTS_FILE = $O/.last-copts
ifneq ("$(COPTS)","$(shell cat $(COPTS_FILE) 2>/dev/null || echo '')")
$(shell $(MKPATH) "$O")
$(file >$(COPTS_FILE),$(COPTS))
endif
#------------------------------------------------------------------------------
# User-supplied makefile fragment(s)
-include makefrag
#------------------------------------------------------------------------------
# Main target
all: $(TARGET_FILES)
$(TARGET_DIR)/% :: $O/%
#mkdir -p $(TARGET_DIR)
$(Q)$(LN) $< $#
ifeq ($(TOOLCHAIN_NAME),clang-msabi)
-$(Q)-$(LN) $(<:%.dll=%.lib) $(#:%.dll=%.lib) 2>/dev/null
endif
$O/$(TARGET): $(OBJS) $(wildcard $(EXTRA_OBJS)) Makefile $(CONFIGFILE)
#$(MKPATH) $O
#echo Creating executable: $#
$(Q)$(CXX) $(LDFLAGS) -o $O/$(TARGET) $(OBJS) $(EXTRA_OBJS) $(AS_NEEDED_OFF) $(WHOLE_ARCHIVE_ON) $(LIBS) $(WHOLE_ARCHIVE_OFF) $(OMNETPP_LIBS)
.PHONY: all clean cleanall depend msgheaders smheaders
.SUFFIXES: .cc
$O/%.o: %.cc $(COPTS_FILE) | msgheaders smheaders
#$(MKPATH) $(dir $#)
$(qecho) "$<"
$(Q)$(CXX) -c $(CXXFLAGS) $(COPTS) -o $# $<
%_m.cc %_m.h: %.msg
$(qecho) MSGC: $<
$(Q)$(MSGC) -s _m.cc -MD -MP -MF $O/$(basename $<)_m.h.d $(MSGCOPTS) $?
%_sm.cc %_sm.h: %.sm
$(qecho) SMC: $<
$(Q)$(SMC) -c++ -suffix cc $(SMCOPTS) $?
msgheaders: $(MSGFILES:.msg=_m.h)
smheaders: $(SMFILES:.sm=_sm.h)
clean:
$(qecho) Cleaning $(TARGET)
$(Q)-rm -rf $O
$(Q)-rm -f $(TARGET_FILES)
$(Q)-rm -f $(call opp_rwildcard, . , *_m.cc *_m.h *_sm.cc *_sm.h)
cleanall:
$(Q)$(CLEANALL_COMMAND)
$(Q)-rm -rf $(PROJECT_OUTPUT_DIR)
help:
#echo "$$HELP_SYNOPSYS"
#echo "$$HELP_TARGETS"
#echo "$$HELP_VARIABLES"
#echo "$$HELP_EXAMPLES"
# include all dependencies
-include $(OBJS:%=%.d) $(MSGFILES:%.msg=$O/%_m.h.d)
It's correct in saying that clang-release/src/v2x is a directory, but it has always been so (even before making the recent changes) and it hasn't produced this error.
Other than the MakeFile error, there is no other error in any of the scripts for the project.
You want to create the executable file clang-release/src/v2x but you can't because that file already exists and is a directory.
The name of the file you attempt to create is
v2x$(D)$(EXE_SUFFIX) and nowhere in your Makefile do you have Make variables D or EXE_SUFFIX defined, so they evaluate to empty strings.
Probably you want to make sure you have D and EXE_SUFFIX defined somewhere.
There is a $(CONFIGFILE) you are including, Make finds it but you did not provide the text of it, check if these variables should be defined in there but are not.

'No rule to make target' while using Netbeans on Mac, remote building to Linux host but only with multiple cpp files

This is a strange one (to me).
I'm finding that if I have a project containing multiple cpp files and I am trying to build them on a remote linux host with the Netbeans IDE, it complains about No Rule to make target for the first additional cpp file and then stops. This issue is not present when building the same project locally or when building to a remote Linux host using Netbeans on Linux.
Firstly, some points of note;
I'm using Netbeans on a Mac.
I'm remote building C++ files onto a remote linux host.
This issue only exists when there are multiple cpp files in the project.
This issue does not exist when remote building on a Linux machine.
The issue is the same whether building from the IDE or running make on the remote host.
I can build the project from the command line on the hose using g++[...]
I can only assume the issue is when Netbeans is generating the makefile variables, but for the life of me, cant seem to find where the problem lies and as I say, it's completely fine when doing the same thing on a Linux machine.
To provide some context, we can consider the following small project;
main.cpp
#include <cstdlib>
#include <stdio.h>
#include "other.h"
int main(int argc, char** argv)
{
printf ("hello %d \n",times_two(50));
return 0;
}
other.h
#ifndef OTHER_H
#define OTHER_H
int times_two(int a);
#endif /* OTHER_H */
other.h
int times_two(int a)
{
return a*2;
}
When building from the IDE to the remote Linux host, we get;
CLEAN SUCCESSFUL (total time: 212ms)
Copying project files to /home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64 at plisken#oracle-linux.shared
Building project files list...
Checking directory structure...
Checking previously uploaded files...
Checking links...
Uploading changed files:
Checking exec permissions...
Uploading changed files finished successfully.
cd '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
/usr/bin/gmake -f Makefile CONF=Debug
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
gmake[1]: Entering directory '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk /home/plisken/PROJECTS/bin/multiple_cpp_files
gmake[2]: Entering directory '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
gmake[2]: *** No rule to make target '/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files/other.cpp', needed by 'build/Debug/GNU-Linux/_ext/96b75cbb/other.o'. Stop.
gmake[2]: Leaving directory '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
gmake[1]: *** [nbproject/Makefile-Debug.mk:60: .build-conf] Error 2
gmake[1]: Leaving directory '/home/plisken/.netbeans/remote/oracle-linux.shared/solaros.local-MacOSX-x86_64/Volumes/D_SLAVE/My Documents/My Projects/multiple_cpp_files/multiple_cpp_files'
gmake: *** [nbproject/Makefile-impl.mk:40: .build-impl] Error 2
BUILD FAILED (exit value 2, total time: 224ms)
The makefiles I believe are relevant and automatically generated are as below;
makefile
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_PLATFORM_${CONF} platform name (current configuration)
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# build tests
build-tests: .build-tests-post
.build-tests-pre:
# Add your pre 'build-tests' code here...
.build-tests-post: .build-tests-impl
# Add your post 'build-tests' code here...
# run tests
test: .test-post
.test-pre: build-tests
# Add your pre 'test' code here...
.test-post: .test-impl
# Add your post 'test' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk
Makefile-impl.mk
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=multiple_cpp_files
# Active Configuration
DEFAULTCONF=Debug
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=Debug Release
# build
.build-impl: .build-pre .validate-impl .depcheck-impl
##echo "=> Running $#... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre .validate-impl .depcheck-impl
##echo "=> Running $#... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
##echo "=> Running $#..."
for CONF in ${ALLCONFS}; \
do \
"${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
done
# all
.all-impl: .all-pre .depcheck-impl
##echo "=> Running $#..."
for CONF in ${ALLCONFS}; \
do \
"${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \
done
# build tests
.build-tests-impl: .build-impl .build-tests-pre
##echo "=> Running $#... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf
# run tests
.test-impl: .build-tests-impl .test-pre
##echo "=> Running $#... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf
# dependency checking support
.depcheck-impl:
#echo "# This code depends on make tool being used" >.dep.inc
#if [ -n "${MAKE_VERSION}" ]; then \
echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES} \$${TESTOBJECTFILES}))" >>.dep.inc; \
echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
echo "include \$${DEPFILES}" >>.dep.inc; \
echo "endif" >>.dep.inc; \
else \
echo ".KEEP_STATE:" >>.dep.inc; \
echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
fi
# configuration validation
.validate-impl:
#if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
echo ""; \
echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
echo "See 'make help' for details."; \
echo "Current directory: " `pwd`; \
echo ""; \
fi
#if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
exit 1; \
fi
# help
.help-impl: .help-pre
#echo "This makefile supports the following configurations:"
#echo " ${ALLCONFS}"
#echo ""
#echo "and the following targets:"
#echo " build (default target)"
#echo " clean"
#echo " clobber"
#echo " all"
#echo " help"
#echo ""
#echo "Makefile Usage:"
#echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
#echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
#echo " make [SUB=no] clobber"
#echo " make [SUB=no] all"
#echo " make help"
#echo ""
#echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
#echo " also build subprojects."
#echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
#echo " also clean subprojects."
#echo "Target 'clobber' will remove all built files from all configurations and,"
#echo " unless 'SUB=no', also from subprojects."
#echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
#echo " also build subprojects."
#echo "Target 'help' prints this message."
#echo ""
Makefile-variables.mk
#
# Generated - do not edit!
#
# NOCDDL
#
CND_BASEDIR=`pwd`
CND_BUILDDIR=build
CND_DISTDIR=dist
# Debug configuration
CND_PLATFORM_Debug=GNU-Linux
CND_ARTIFACT_DIR_Debug=/home/plisken/PROJECTS/bin
CND_ARTIFACT_NAME_Debug=multiple_cpp_files
CND_ARTIFACT_PATH_Debug=/home/plisken/PROJECTS/bin/multiple_cpp_files
CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux/package
CND_PACKAGE_NAME_Debug=multiplecppfiles.tar
CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux/package/multiplecppfiles.tar
# Release configuration
CND_PLATFORM_Release=GNU-MacOSX
CND_ARTIFACT_DIR_Release=dist/Release/GNU-MacOSX
CND_ARTIFACT_NAME_Release=multiple_cpp_files
CND_ARTIFACT_PATH_Release=dist/Release/GNU-MacOSX/multiple_cpp_files
CND_PACKAGE_DIR_Release=dist/Release/GNU-MacOSX/package
CND_PACKAGE_NAME_Release=multiplecppfiles.tar
CND_PACKAGE_PATH_Release=dist/Release/GNU-MacOSX/package/multiplecppfiles.tar
#
# include compiler specific variables
#
# dmake command
ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \
(mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)
#
# gmake command
.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk))
#
include nbproject/private/Makefile-variables.mk
Makefile-debug.mk
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Environment
MKDIR=mkdir
CP=cp
GREP=grep
NM=nm
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc
CCC=g++
CXX=g++
FC=gfortran
AS=as
# Macros
CND_PLATFORM=GNU-Linux
CND_DLIB_EXT=so
CND_CONF=Debug
CND_DISTDIR=dist
CND_BUILDDIR=build
# Include project Makefile
include Makefile
# Object Directory
OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
# Object Files
OBJECTFILES= \
${OBJECTDIR}/_ext/96b75cbb/other.o \
${OBJECTDIR}/main.o
# C Compiler Flags
CFLAGS=
# CC Compiler Flags
CCFLAGS=
CXXFLAGS=
# Fortran Compiler Flags
FFLAGS=
# Assembler Flags
ASFLAGS=
# Link Libraries and Options
LDLIBSOPTIONS=
# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
"${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk /home/plisken/PROJECTS/bin/multiple_cpp_files
/home/plisken/PROJECTS/bin/multiple_cpp_files: ${OBJECTFILES}
${MKDIR} -p /home/plisken/PROJECTS/bin
${LINK.cc} -o /home/plisken/PROJECTS/bin/multiple_cpp_files ${OBJECTFILES} ${LDLIBSOPTIONS}
${OBJECTDIR}/_ext/96b75cbb/other.o: /Volumes/D_SLAVE/My\ Documents/My\ Projects/multiple_cpp_files/multiple_cpp_files/other.cpp
${MKDIR} -p ${OBJECTDIR}/_ext/96b75cbb
${RM} "$#.d"
$(COMPILE.cc) -g -I/Volumes/D_SLAVE/My\ Documents/My\ Projects/multiple_cpp_files/multiple_cpp_files -MMD -MP -MF "$#.d" -o ${OBJECTDIR}/_ext/96b75cbb/other.o /Volumes/D_SLAVE/My\ Documents/My\ Projects/multiple_cpp_files/multiple_cpp_files/other.cpp
${OBJECTDIR}/main.o: main.cpp
${MKDIR} -p ${OBJECTDIR}
${RM} "$#.d"
$(COMPILE.cc) -g -I/Volumes/D_SLAVE/My\ Documents/My\ Projects/multiple_cpp_files/multiple_cpp_files -MMD -MP -MF "$#.d" -o ${OBJECTDIR}/main.o main.cpp
# Subprojects
.build-subprojects:
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r ${CND_BUILDDIR}/${CND_CONF}
# Subprojects
.clean-subprojects:
# Enable dependency checking
.dep.inc: .depcheck-impl
include .dep.inc
To be clear, if I log onto the remote host where the files are and run;
g++ -o test main.cpp other.cpp
it naturally builds completely fine.
Any suggestions would be greatly appreciated.

No rule to make target 'bootstrap', needed by 'distdir-am'. Stop

I'm having the following problem when using automake to 'make dist'. Below is a snap shot of the error being reported by the compiler. I'm using Debian 10.5, with the default compiler version 8.0.3; autoconf 2.69; automake 1.16.1, libtool 2.4.6
######## Problem ########
aperri#debian:~/XerlangCPL2$ make dist
make dist-gzip am__post_remove_distdir='#:'
make[1]: Entering directory '/home/aperri/XerlangCPL2'
make distdir-am
make[2]: Entering directory '/home/aperri/XerlangCPL2'
make[2]: *** No rule to make target 'bootstrap', needed by 'distdir-am'. Stop.
make[2]: Leaving directory '/home/aperri/XerlangCPL2'
make[1]: *** [Makefile:633: distdir] Error 2
make[1]: Leaving directory '/home/aperri/XerlangCPL2'
make: *** [Makefile:710: dist] Error 2
I'm including my configure.ac and makefile.am in this message with the hope that there is a solution to this problem
######## configure.ac ########
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([XerlangCPL], [1.0], [aperri1001#gmail.com])
AC_CONFIG_SRCDIR([src/xmlPROC.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
# Enable "automake" to simplify creating Makefiles
AM_INIT_AUTOMAKE([1.16.1 subdir-objects -Wall -Werror])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Checks for programs.
AC_PROG_CC
AC_PROG_CXXCPP
AC_PROG_CXX
# Used in conjuction with {TARGET}_CPPFLAGS = -DDEBUG in Makefile.am
AM_PROG_CC_C_O
# Checks for libraries.
AX_BOOST_BASE([1.67], [], AC_MSG_ERROR([Could not find a useful version of boost]))
AX_BOOST_FILESYSTEM
AX_BOOST_SYSTEM
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_REGEX
# AX_BOOST_DATE_TIME
# AX_BOOST_THREAD
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions
PKG_CHECK_MODULES(libxml, libxml++-2.6 >= 2.10.0 )
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -z "$DOXYGEN";
then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
fi
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
AC_CONFIG_FILES([Makefile doc/Doxyfile])
# AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
# AC_ARG_WITH(debug, [ --with-debug add the debugging module], [AC_DEFINE(WITH_DEBUG,1,0)
# AC_SUBST(WITH_DEBUG,1)
# CXXFLAGS="-O0 -ggdb"])
AC_OUTPUT
echo "
XErlang Compiler ($PACKAGE_NAME) version $PACKAGE_VERSION
Prefix.........: $prefix
Debug Build....: $debug
C++ Compiler...: $CXX $CXXFLAGS $CPPFLAGS
Linker.........: $LD $LDFLAGS $LIBS
"
######## makefile.am ########
ACLOCAL_AMFLAGS = -I m4 --install
bin_PROGRAMS = xerlangCPL
xerlangCPL_SOURCES = \
src/xmlPROC.cpp \
src/xml_structs.h \
src/debug.h \
src/conxsTracker.cpp \
src/conxs_tracker.h \
src/xmlConxsParser.cpp \
src/oven_control
xerlangCPL_LDFLAGS = -DDEBUG \
$(libxml_LIBS) \
$(BOOST_LDFLAGS) \
$(BOOST_SYSTEM_LDFLAGS) \
$(BOOST_FILESYSTEM_LDFLAGS) \
$(BOOST_PROGRAM_OPTIONS_LDFLAGS)
xerlangCPL_CPPFLAGS = $(libxml_CFLAGS) \
$(BOOST_CPPFLAGS)
xerlangCPL_LIBS = $(BOOST_SYSTEM_LIBS) \
$(BOOST_FILESYSTEM_LIBS) \
$(BOOST_PROGRAM_OPTIONS_LIBS)
xerlangCPL_CXXFLAGS = -lboost_filesystem -ldl -lboost_system
# start of Doxygen section
if HAVE_DOXYGEN
doxyfile.stamp:
$(DOXYGEN) $(top_srcdir)/doc/Doxyfile
echo Timestamp > $#
CLEANFILES = $(top_srcdir)/doxyfile.stamp
# all-local: doxyfile.stamp
all-local: doxyfile.stamp
# clean-local:
# rm -rf $(top_srcdir)/
endif
EXTRA_DIST = bootstrap m4/NOTES
The problem could be related to the inclusion of Boost Modules or the lack of them.
The problem is that EXTRA_DIST lists some mysterious file called bootstrap.
Makefile.am provides no instructions for building this file.
Therefore, this file is expected to already exist in the build directory, and it does not.
That's the reason for your make dist failure.
The reason for the missing file is something that you'll have to figure out on your own, the only thing that can be stated here is that its absence is the reason for your build failure.
You could, of course
touch bootstrap
and create an empty file in the build directory, which will be good enough. But you should investigate, in your project, what this file is, and where it should come from, and fix things accordingly.

Yocto build opengl cts failed

I am trying to build opengl cts into yocto. I created a recipe to do so:
DESCRIPTION = "OpenGL CTS"
LICENSE = "Apache-2.0"
PR = "r0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=67d07a07ec29a50a3ded12b2ba952257"
SRCREV = "77705f0d7a813bdac9c91385e46bff98b16320c9"
SRC_URI = "git://github.com/KhronosGroup/VK-GL-CTS.git;protocol=https"
S = "${WORKDIR}/git"
inherit pkgconfig cmake
The build process for the above recipe failed with the following output at do_compile() method:
| [ 17%] Linking CXX static library libglutil.a
| cd /home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build/framework/opengl && /home/fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/cmake -P CMakeFiles/glutil.dir/cmake_clean_target.cmake
| cd /home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build/framework/opengl && /fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/glutil.dir/link.txt --verbose=1
| arm-poky-linux-gnueabi-ar qc libglutil.a CMakeFiles/glutil.dir/gluContextInfo.cpp.o CMakeFiles/glutil.dir/gluDefs.cpp.o CMakeFiles/glutil.dir/gluDrawUtil.cpp.o CMakeFiles/glutil.dir/gluES3PlusWrapperContext.cpp.o CMakeFiles/glutil.dir/gluFboRenderContext.cpp.o CMakeFiles/glutil.dir/gluPixelTransfer.cpp.o CMakeFiles/glutil.dir/gluProgramInterfaceQuery.cpp.o CMakeFiles/glutil.dir/gluRenderConfig.cpp.o CMakeFiles/glutil.dir/gluRenderContext.cpp.o CMakeFiles/glutil.dir/gluShaderProgram.cpp.o CMakeFiles/glutil.dir/gluShaderUtil.cpp.o CMakeFiles/glutil.dir/gluStateReset.cpp.o CMakeFiles/glutil.dir/gluTexture.cpp.o CMakeFiles/glutil.dir/gluTextureUtil.cpp.o CMakeFiles/glutil.dir/gluTextureTestUtil.cpp.o CMakeFiles/glutil.dir/gluVarType.cpp.o CMakeFiles/glutil.dir/gluVarTypeUtil.cpp.o CMakeFiles/glutil.dir/gluStrUtil.cpp.o CMakeFiles/glutil.dir/gluCallLogWrapper.cpp.o CMakeFiles/glutil.dir/gluObjectWrapper.cpp.o CMakeFiles/glutil.dir/gluContextFactory.cpp.o CMakeFiles/glutil.dir/gluDummyRenderContext.cpp.o CMakeFiles/glutil.dir/gluPlatform.cpp.o CMakeFiles/glutil.dir/gluShaderLibrary.cpp.o
| /home/fsl-arm-yocto-bsp/build-x11/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ranlib libglutil.a
| make[2]: Leaving directory '/home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build'
| [ 17%] Built target glutil
| make[1]: Leaving directory '/home/fsl-arm-yocto-bsp/build-x11/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/deqp/1.0-r0/build'
| Makefile:86: recipe for target 'all' failed
| make: *** [all] Error 2
| WARNING: exit code 1 from a shell command.
| ERROR: oe_runmake failed

Cannot totally compile and link cpp project as a static library

I have followed this link and adapted its steps to make it work for my project.
My goal is to create a libfile.a to distribute as a static library. The project tree is the following:
project
|
+-src
+- <some cpp and hpp files>
|
+ containers
|
+- <other cpp and hpp files>
I easily created configure.ac file and the Makefile.ams. The tree structure changed this way:
project
|
+- configure.ac
+- Makefile.am
+-src
+- <some cpp and hpp files>
+ Makefile.am
|
+ containers
|
+- <other cpp and hpp files>
Now, when I go: (*)
aclocal; autoreconf --install; autoconf; ./configure
make
.o files are generated for all the .*pp files contained in src, but it fails when it starts generating those targets in src/containers. So the Makefile is not generated properly. What am I doing wrong? Can someone help me?
PS here there are files involved:
# --- configure.ac ---
AC_PREREQ([2.68])
AC_INIT([filea], [1.0], [dev#host.net])
AM_INIT_AUTOMAKE([filea], [1.0])
AC_CONFIG_SRCDIR([src/HashFunctions.cpp])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
AC_PROG_RANLIB
AC_CHECK_HEADERS([stddef.h stdint.h string.h])
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_CHECK_FUNCS([memset])
AC_OUTPUT([Makefile src/Makefile])
# --- Makefile.am ---
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src
# --- src/Makefile.am ---
lib_LIBRARIES = libfile.a
libfile_a_SOURCES = \
ConfigLib.hpp \
ConfigLib.cpp \
HashFunctions.cpp \
HashFunctions.hpp \
Logger.hpp \
Logger.cpp \
Queue.hpp
libfile_a_SOURCES += \
containers/SafeContainer.cpp \
containers/SafeInterger.cpp \
containers/SafeMap.cpp
EDIT 1
as suggested by Brett Hale the commands marked with (*) have been replaced by the following ones:
autoreconf -fvi
Output:
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
When going with:
./configure
make
Still no rules are found to generate targets in the subdirectory.
EDIT 2 I switched to a non-recursive approach (Thanks to Karel Zak's blog) and finally I can makemy lib.
Still I don't know what I was doing wrong following the typical recursive approach; but, finally I made this work, switching to a non-recursive approach (as I wrote in EDIT 2). This article on Karel Zak's Blog helped me a lot!
# -- new configure.ac file --
AC_PREREQ([2.68])
AC_INIT([filea], [1.0], [dev#host.net])
AM_INIT_AUTOMAKE([filea], [1.0])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/HashFunctions.cpp])
AM_INIT_AUTOMAKE([filea], [1.0])
LT_INIT
AC_CANONICAL_HOST
AC_PROG_LIBTOOL
AC_PROG_GREP
AC_PROG_EGREP
AC_PROG_CXX
...
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_CHECK_FUNCS([memset socket])
AC_OUTPUT([Makefile]) # the makefile is only one!
# In the subdirectory I have created few
# Makemodule.am included in the "main makefile.am"
# --- makefile.am ---
AUTOMAKE_OPTIONS = foreign
lib_LIBRARIES = filea.a
libfilea_a_SOURCES =
include src/Makemodule.am
include src/containers/Makemodule.am # now filea_a_SOURCES is a
# "global variable"
# -- src/Makemodule.am
libfilea_a_SOURCES += \
src/ConfigLib.hpp \
src/ConfigLib.cpp \
src/HashFunctions.cpp \
src/HashFunctions.hpp \
src/Logger.hpp \
src/Logger.cpp \
src/Queue.hpp
# -- src/containers/Makemodule.am
libfile_a_SOURCES += \
src/containers/SafeContainer.cpp \
src/containers/SafeInterger.cpp \
src/containers/SafeMap.cpp
Notice that now, even if Makemodule.am files are placed at different levels in the dir tree, whenever a filename is typed in one those modules, it has to be preceded by its relative path. This path is relative to Makefile location.