-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
35 lines (28 loc) · 828 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
CXX = g++
VERSION = v0.1.1
CHARSET = UTF-8
PROGRAM_NAME = IV⇆\ PID
# If Windows, sets the Western Europe charset
ifdef SystemRoot
CHARSET = CP850
PROGRAM_NAME = IV-PID
endif
CXXFLAGS = -O3 -m32 -static -s -Wall -Iinclude -flto
STRINGSFLAGS = -fexec-charset=$(CHARSET)
IO = cmdline_io
IOFLAGS = $(STRINGFLAGS) -DPROGRAM_NAME=\"$(PROGRAM_NAME)\" -DVERSION=\"$(VERSION)\"
OBJ = obj
SRC = src
STR = strings
.INTERMEDIATE: $(OBJ)/$(IO).o
all: iv-pid_eng iv-pid_esp
$(OBJ):
mkdir $@
$(OBJ)/strings_%.o: $(STR)/%.c $(OBJ)
$(CXX) $(CXXFLAGS) $(STRINGSFLAGS) -c $< -o $@
$(OBJ)/$(IO).o: $(SRC)/$(IO).cpp $(OBJ)
$(CXX) $(CXXFLAGS) $(IOFLAGS) -c $< -o $@
$(OBJ)/%.o: $(SRC)/%.cpp $(OBJ)
$(CXX) $(CXXFLAGS) -c $< -o $@
iv-pid_%: $(OBJ)/iv-pid.o $(OBJ)/$(IO).o $(OBJ)/func.o $(OBJ)/strings_%.o
$(CXX) $(CXXFLAGS) $^ -o $@