I am currently trying to generate makefile that can handle generating dependancies for a C and C++ raytracer project. I need assistance in generating the include files being used.
# Makefile
# Default Directories:
# bin the binary directory
# inc the include directory
# obj the object directory
# src the source directory
BIN_DIR := bin
INC_DIR := inc
OBJ_DIR := obj
SRC_DIR := src
# The compiler: gcc for C programs, define as g++ for C++
CC := gcc
CXX := g++
# Compiler flags:
# -g adds debugging information to the executable file
# -Wall turns on most, but not all, compiler warnings
# -O2/O3 defines the optimization level of the program(s)
CFLAGS := -g -Wall -O2
CXXFLAGS := -g -Wall -O3
INCLUDES := -I$(INC_DIR)
My file structure is the following:
Raytracer
|
|___bin
|
|___inc
| |__Geometric
| |____Vector3D.h
|
|___obj
|
|___src
|__Geometric
| |______Vector3D.c
| |______Vector3D.cpp
|
|___Main
|__Main.c
|__Main.cpp
In the Vector3D.h file, I used a template format in and initialized:
#ifndef __VECTOR3D_H__
#define __VECTOR3D_H__
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
// C Methods defined surrounded with __cplusplus & extern "C" {...}
#ifdef __cplusplus
#include <sstream>
#include <iostream>
namespace Geometric {
template <typename T = float>
class Vector3D { // Vector3D
// Constructors already defined...
// Methods already defined...
// Etc...
}; // The 'Vector3D' Class
// Implemented constructors...
// Implemented Methods...
// Implemented Etc...
} // The 'Geometric' Namespace
#endif /* __cplusplus */
#endif /* __VECTOR3D_H__ */
When defining the Vector3D.c & Vector3D.cpp files should i use:
#include "Geometric/Vector3D.h"
// Or
#include <Geometric/Vector3D.h>
// Or does it matter...