Instruct Automake to use C++ compiler for *.S files?
Clash Royale CLAN TAG #URR8PPP Instruct Automake to use C++ compiler for *.S files? We have a C++ project. We need to assemble a *.S file through the compiler. In our GNUmakefile we use: *.S GNUmakefile # ARM asm implementation. aes-armv4.o : aes-armv4.S $(CXX) $(CXXFLAGS) $(AES_FLAGS) -mfloat-abi=$(FP_ABI) -c $< We have the following in our Makefile.am , which depends on AC_SUBST([AES_FLAGS], [-march=armv7-a -Wa,--noexecstack]) in configure.ac : Makefile.am AC_SUBST([AES_FLAGS], [-march=armv7-a -Wa,--noexecstack]) configure.ac libaes_armv4_la_SOURCES = aes-armv4.S libaes_armv4_la_CXXFLAGS = $(AM_CXXFLAGS) $(AES_FLAGS) However, the resulting Makefile uses the C compiler and fails to use the flags we setup for the source file: Makefile C make[1]: Entering directory '/home/build/cryptopp' /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -g -O2 -MT aes-armv4.lo -MD -MP -MF .deps/aes-armv4.Tpo -c -o aes-armv4.lo aes-armv4.S libtool: compile: gcc -DHAVE_CONFIG_...