I added some c code into a c++ code base on a windows machine; it was working on windows visual studio fine; but I'm having a hard time trying to get it to run on linux.
Below file is a subdir.mk that is run with a makefile. I'm editing this file written for purely c++ on a linux64 system to add my c changes. I added cc sources as you can see below. I'm new at this. I heared that if you have flags make knows how to build but the existing file had this rule %.o: ../%.cpp and it won't work without it. I tried adding %.o: ../%.c in different ways (with a , and then by piping) but was not successful.
Do you see what I'm doing wrong here? Any feedback welcome. Thx!
CC=gcc
CXX=g++
CXXFLAGS=-Wall -g
CCFLAGS=-g
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../x.cpp \
../y.cpp \
../main.cpp
CC_SRCS += \
../z__c.c
OBJS += \
./x.o \
./y.o \
./z__c.o \
./main.o
CPP_DEPS += \
./x.d \
./y.d \
./main.d
icpc='/opt/shared/sw/x86_64-unknown-linux-gnu/gcc/5.3.0-rhel6/bin/g++'
CC='/opt/shared/sw/x86_64-unknown-linux-gnu/gcc/5.3.0-rhel6/bin/gcc'
# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.cpp
#%.o: ../%.c
@echo 'Building file: $<'
@echo 'Invoking: G++ Compiler'
g++ -Wall -mavx -g -O -O1 -std=c++11 -L/opt/shared/sw/x86_64-unknown-linux-gnu/gcc/5.3.0-rhel6/lib64 -libstdc -libsupc++ -libtsan -libubsan -libvtv -libquadmath -libgcc_s -libgcj -L/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64 -lmkl_mc -lmkl_sequential -lmkl_gf_ilp64 -lmkl_avx -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_core -lmkl_gnu_thread -L/home../oed -liboed -liboedlib -I/opt/intel/composer_xe_2013.5.192/mkl/include
-I/opt/shared/sw/x86_64-unknown-linux-gnu/gcc/5.3.0-rhel6/include -I/home..include -I/home../debug -DDEBUG -DMKL_ILP64
-MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -c -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '