forked from mwachs5/trace-decoder
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile.init
52 lines (48 loc) · 1.57 KB
/
makefile.init
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
%.o: ../src/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: GCC C++ Compiler'
$(CROSSPREFIX)g++ -I"../include" $(CFLAGS) -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
OBJS += ./dqr.o ./main.o ./trace.o
ifeq ($(OS),Windows_NT)
CFLAGS += -D WINDOWS -std=c++11
LIBPATH = ../lib/windows
LNFLAGS = -static
LIBS := -lbfd -lopcodes -lintl -liberty -lz
EXECUTABLE := dqr.exe
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
REDHAT_REL := $(wildcard /etc/redhat-release)
ifneq ($(REDHAT_REL),)
CFLAGS += -D LINUX -std=c++11
LIBPATH = ../lib/linux
LIBS := -lbfd -lopcodes -liberty -lz -ldl
LNFLAGS =
EXECUTABLE := dqr
else
ifeq ($(CROSSPREFIX),x86_64-w64-mingw32-)
CFLAGS += -D WINDOWS -std=c++11
LIBPATH = ../lib/windows
LNFLAGS = -static
LIBS := -lbfd -lopcodes -lintl -liberty -lz
EXECUTABLE := dqr.exe
else
CFLAGS += -D LINUX -std=c++11
LIBPATH = ../lib/linux
LIBS := -lbfd -lopcodes -liberty -lz -ldl
LNFLAGS = -static
EXECUTABLE := dqr
endif
endif
endif
ifeq ($(UNAME_S),Darwin)
CFLAGS += -D OSX -std=c++11
LIBPATH = ../lib/macos
LIBS := -lbfd -lopcodes -liberty -lz -lintl -liconv
LNFLAGS =
EXECUTABLE := dqr
endif
UNAME_P := $(shell uname -p)
endif