-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile.bak
More file actions
37 lines (31 loc) · 809 Bytes
/
makefile.bak
File metadata and controls
37 lines (31 loc) · 809 Bytes
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
COMPILER = g++
CFLAGS = -g -MMD -MP -Wall -Wextra -Winit-self -Wno-missing-field-initializers
ifeq "$(shell getconf LONG_BIT)" "64"
LDFLAGS =
else
LDFLAGS =
endif
INCLUDE = -I./src
TARGETDIR = ./bin
TARGET = $(TARGETDIR)/lib$(shell basename `readlink -f .`)
SRCDIR = ./src/source
ifeq "$(strip $(SRCDIR))" ""
SRCDIR = .
endif
SOURCES = $(wildcard $(SRCDIR)/*.cpp)
OBJDIR = ./obj
ifeq "$(strip $(OBJDIR))" ""
OBJDIR = .
endif
OBJECTS = $(addprefix $(OBJDIR)/, $(notdir $(SOURCES:.cpp=.o)))
DEPENDS = $(OBJECTS:.o=.d)
$(TARGET): $(OBJECTS)
-mkdir -p $(TARGETDIR)
ar rvcs $(TARGET).a $^
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
-mkdir -p $(OBJDIR)
$(COMPILER) $(CFLAGS) $(INCLUDE) -o $@ -c $<
all: clean $(TARGET)
clean:
-rm -f $(OBJECTS) $(DEPENDS) $(TARGET)
-include $(DEPENDS)