summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7a0491ac86f30174ff217ae419dc2c6ead361174 (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
36
37
# 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)

INCLUDE   = -I../lib/scriptpp


default: $(LIB)

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

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

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

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

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