forked from Francesco149/oppai
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·62 lines (51 loc) · 1.58 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# ------------------------------------------------------------------------------
# Generic C++ Makefile
#
# Version: 1.0
# Author: Franc[e]sco
# Description:
# Compiles all .cc, .s and .S files in SRCDIR to obj files in OBJDIR, then gets
# rid of unused code.
# ------------------------------------------------------------------------------
TARGET = oppai
CXX = g++
CXXFLAGS = -std=c++14 -Wall -Werror -DOPPAI_VERBOSE
CXXFLAGS += -DOPPAI_FAST
#CXXFLAGS += -D_DEBUG
#CXXFLAGS += -DSHOW_BEATMAP -DSLIDERTEST
#CXXFLAGS = $(CXXFLAGS) -DSLIDERFIX
LINKER = $(CXX) -o
LFLAGS = -lm -lstdc++ #-lGL -lglut
SRCDIR = .
OBJDIR = obj
BINDIR = .
SOURCES := $(wildcard $(SRCDIR)/*.cc)
SSOURCES := $(wildcard $(SRCDIR)/*.s)
USSOURCES := $(wildcard $(SRCDIR)/*.S)
OBJECTS := $(SOURCES:$(SRCDIR)/%.cc=$(OBJDIR)/%.o)
SOBJECTS := $(SSOURCES:$(SRCDIR)/%.s=$(OBJDIR)/%.o)
USOBJECTS := $(USSOURCES:$(SRCDIR)/%.S=$(OBJDIR)/%.o)
$(BINDIR)/$(TARGET): dirs $(OBJECTS) $(SOBJECTS) $(USOBJECTS)
@echo "Linking..."
@$(LINKER) $@ $(OBJECTS) $(SOBJECTS) $(USOBJECTS) $(LFLAGS)
@echo "Stripping..."
@strip -R .comment $@
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cc
@echo "Compiling "$<"..."
@$(CXX) $(CXXFLAGS) -c $< -o $@
$(SOBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.s
@echo "Compiling ASM "$<"..."
@$(CXX) $(CXXFLAGS) -c $< -o $@
$(USOBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.S
@echo "Compiling ASM "$<" (with preprocessor)..."
@$(CXX) $(CXXFLAGS) -c $< -o $@
dirs:
@mkdir -p $(OBJDIR)
@mkdir -p $(BINDIR)
.PHONEY: clean
clean:
@echo "Cleaning..."
rm -f $(OBJECTS)
rm -f $(SOBJECTS)
rm -f $(USOBJECTS)
rm -f $(BINDIR)/$(TARGET)