-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
43 lines (29 loc) · 802 Bytes
/
Makefile
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
38
39
40
41
42
############
CC= gcc
CXX= g++
CCFLAGS= -g
CXXFLAGS= -g
# include directories and libraries
INC= -I./include
LIB=
# object files have corresponding source files
OBJDIR= objs
C_SOURCES = $(wildcard src/*.c)
CXX_SOURCES = $(wildcard src/*.cpp)
C_OBJS= $(patsubst src/%.c, $(OBJDIR)/%.o, $(C_SOURCES))
CXX_OBJS= $(patsubst src/%.cpp, $(OBJDIR)/%.o, $(CXX_SOURCES))
# bin output
BINDIR= bin
EXEC= $(addprefix $(BINDIR)/, cube2equirect)
mkdirs:= $(shell mkdir -p $(OBJDIR) $(BINDIR))
# BUILD EVERYTHING
all: $(EXEC)
$(EXEC): $(C_OBJS) $(CXX_OBJS)
$(CXX) $(CXXFLAGS) -o $(EXEC) $(C_OBJS) $(CXX_OBJS) $(LIB)
$(OBJDIR)/%.o: src/%.c
$(CC) -c $(CCFLAGS) -o $@ $< $(INC)
$(OBJDIR)/%.o: src/%.cpp
$(CXX) -c $(CXXFLAGS) -o $@ $< $(INC)
# REMOVE OLD FILES
clean:
rm -f $(EXEC) $(C_OBJS) $(CXX_OBJS)