summaryrefslogtreecommitdiff
path: root/Makefile
blob: 09a764dcc7cb422bbfa466e80658703f187f2f15 (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
29
30
31
32
33
34
35
# Debug mode:
# DEBUG   = yes

CC        = g++
LIB       = libtexo.a

CPPFLAGS  = -Wall -ansi
ifeq '$(DEBUG)' 'yes'
CPPFLAGS += -g -O0
else
CPPFLAGS += -O3
endif

SRC_DIR   = src
SRC       = $(wildcard $(SRC_DIR)/*.cpp)
OBJ       = $(SRC:.cpp=.o)


default: $(LIB)

ifneq "clean" "$(MAKECMDGOALS)"
-include deps.mk
endif

deps.mk: $(SRC)
	$(CC) -MM $^ > $@

%.o: %.cpp %.hpp
	$(CC) $(CPPFLAGS) -c $< -o $@

$(LIB): $(OBJ)
	ar rcs $@ $^

clean:
	rm -f $(OBJ) $(LIB) deps.mk