-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathMakefile.unix
45 lines (30 loc) · 897 Bytes
/
Makefile.unix
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
all: ext2rd
ifeq ($(D),)
OPT=-O3
else
OPT=-O0
endif
ifneq ($(wildcard $(SystemRoot)/explorer.exe $(SYSTEMROOT)/explorer.exe),)
OSTYPE=windows
endif
O=$(if $(filter $(OSTYPE),windows),.obj,.o)
E=$(if $(filter $(OSTYPE),windows),.exe,)
EXEOPT=$(if $(filter $(OSTYPE),windows),-Fe:,-o)
clean:
$(RM) -r $(wildcard *$(O)) *.dSYM ext2rd
ext2rd$(E): ext2rd$(O) stringutils$(O)
CXXFLAGS+=-g -Wall -c $(OPT) -I itslib -D_UNIX -D_NO_RAPI -I /usr/local/include -I . -std=c++17
CXXFLAGS+=$(if $(filter $(OSTYPE),windows),-I c:/local/boost_1_74_0)
# include CDEFS from make commandline
CXXFLAGS+=$(CDEFS) -MD
CXXFLAGS+=-DNOMINMAX
LDFLAGS+=-g -Wall -L/usr/local/lib -std=c++17
vpath .cpp itslib/src .
%$(O): itslib/src/%.cpp
$(CXX) -c $(CXXFLAGS) $^ -o $@
%$(O): %.cpp
$(CXX) -c $(CXXFLAGS) $(filter %.cpp,$^) -o $@
%$(E): %$(O)
$(CXX) $(LDFLAGS) $^ $(EXEOPT)$@
install:
cp ext2rd ~/bin/