pad.mattdiesel.co.uk

Snippet - Template Makefile

Template Makefile (Base Makefile)


Created 2015-02-18 10:46:46.417520 by Matt.
Modified 2015-02-18 10:47:03.567610 by Matt.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
CC = g++
RM = rm -f

TARGET = a.out
COMPILE_OPTIONS = -g -std=c++0x -Wall
LINK_OPTIONS = 

SRCS := $(wildcard *.cc)
OBJS = $(SRCS:.cc=.o)

$(TARGET): $(OBJS)
	$(CC) $(COMPILE_OPTIONS) $(OBJS) -o$(TARGET) $(LINK_OPTIONS)

$(OBJS): %.o : %.h

%.o: %.cc
	$(CC) $(COMPILE_OPTIONS) -c $< -o $@

clean:
	$(RM) $(OBJS) ./$(TARGET)

all: $(TARGET)