Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8214dabe9d1432410b2e830dd920724342ec03ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

OBJS = ${projectName}.o

ifeq ($(BUILD_MODE),debug)
	CFLAGS += -g
endif

all:	${projectName}

${projectName}:	$(OBJS)
	$(CXX) -o $@ $^

%.o:	$(PROJECT_ROOT)%.cpp
	$(CXX) -c $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) -o $@ $<

%.o:	$(PROJECT_ROOT)%.c
	$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<

clean:
	rm -fr ${projectName} $(OBJS)

Back to the top