forked from MacPaw/XADMaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.linux
105 lines (74 loc) · 2.08 KB
/
Makefile.linux
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Compilers and linkers
OBJCC = gcc
CC = gcc
CXX = g++
LD = $(CXX)
AR = ar
# Options for compilation
GNUSTEP_OPTS = -DGNUSTEP \
-DGNU_RUNTIME=1 \
-D_NATIVE_OBJC_EXCEPTIONS \
-fgnu-runtime \
-fexceptions \
-fobjc-exceptions \
-fconstant-string-class=NSConstantString
GCC_OPTS = -O2 \
-Wno-import \
-Wno-multichar \
-g \
-D_FILE_OFFSET_BITS=64 \
-isystem /usr/include/GNUstep
OBJC_OPTS = -std=gnu99
C_OPTS = -std=gnu99
CXX_OPTS =
AUTODEPENDENCY_CFLAGS=-MMD -MF$(@:.o=.d) -MT$@
ALL_OBJCFLAGS = $(OBJC_OPTS) $(GCC_OPTS) $(GNUSTEP_OPTS) $(CFLAGS) $(OBJCFLAGS)
ALL_CFLAGS = $(C_OPTS) $(GCC_OPTS) $(CFLAGS)
ALL_CXXFLAGS = $(CXX_OPTS) $(GCC_OPTS) $(CXXFLAGS)
# Options for linking
LIBS = -Wl,--no-whole-archive \
-lgnustep-base \
-lz \
-lbz2 \
-lwavpack \
-licuuc \
-lobjc \
-lm
ALL_LDFLAGS = -Wl,--whole-archive \
-fexceptions \
-fgnu-runtime \
$(LDFLAGS)
# Paths
SOURCE_DIR = .
BUILD_DIR = Build
# Files
PLATFORM_OBJC_FILES = XADPlatformLinux.m \
XADStringICU.m
include Makefile.common
# Compilation rules
all: $(EXECUTABLE_FILES) $(LIBRARY_FILES)
libXADMaster.a: $(LIBRARY_OBJS)
rm -f $@
$(AR) rcs $@ $^
../UniversalDetector/libUniversalDetector.a:
make -C ../UniversalDetector -f Makefile.linux
unar: $(UNAR_OBJS) $(CMDLINE_OBJS) libXADMaster.a ../UniversalDetector/libUniversalDetector.a
$(LD) $(ALL_LDFLAGS) -o $@ $^ $(LIBS)
lsar: $(LSAR_OBJS) $(CMDLINE_OBJS) libXADMaster.a ../UniversalDetector/libUniversalDetector.a
$(LD) $(ALL_LDFLAGS) -o $@ $^ $(LIBS)
clean:
rm -rf $(BUILD_DIR) $(EXECUTABLE_FILES) $(LIBRARY_FILES)
make -C ../UniversalDetector -f Makefile.linux clean
.PHONY: ../UniversalDetector/libUniversalDetector.a clean
# Suffix rules
.SUFFIXES: .o .c .m .cpp
$(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.c
@mkdir -p $(dir $@)
$(CC) $(ALL_CFLAGS) $(AUTODEPENDENCY_CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.m
@mkdir -p $(dir $@)
$(OBJCC) $(ALL_OBJCFLAGS) $(AUTODEPENDENCY_CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(ALL_CXXFLAGS) $(AUTODEPENDENCY_CFLAGS) -c $< -o $@
-include $(OBJS:.o=.d)