summaryrefslogtreecommitdiffstats
path: root/code/templates/Makefile_cpp
blob: 2edcbbfcdfd8022ea8141833c22fc08cc5f57cdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# C++ template Makefile for small projects with gmake
#
# Chose a program name (PROGRAM) and add all the .cpp files (not .h) to #
# CXX_SRCS. Run `make depends` and paste # the output of that command at the
# bottom and then run `make` to generate an executable. 
#
# From http://homepages.gac.edu/~mc38/2001J/documentation/gmake.html
PROGRAM = rename_me
LOADLIBES = 
CXX_SRCS = main.cpp
CXX = g++
CXXFLAGS = -g -Wall -fno-builtins 
CC = gcc
LDFLAGS = -g
OBJS = $(CXX_SRCS:.cpp=.o)

$(PROGRAM) : $(OBJS)
	$(CXX) $(LDFLAGS) $(OBJS) $(LOADLIBES) -o $(PROGRAM)

clean:
	/bin/rm -qf *.o $(PROGRAM) *~

depend:
	$(CXX) -MM $(CXX_SRCS)

###
# <DEPENDENCIES ON .h FILES GO HERE>