forked from MacPaw/XADMaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.freebsd
122 lines (86 loc) · 2.82 KB
/
Makefile.freebsd
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Compilers and linkers
OBJCC = clang
CC = clang
CXX = clang++
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/local/GNUstep/System/Library/Headers \
-I/usr/local/include
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 \
-licuuc \
-lobjc \
-lm
ALL_LDFLAGS = -Wl,--whole-archive \
-fexceptions \
-fgnu-runtime \
-L/usr/local/lib \
-L/usr/local/GNUstep/System/Library/Libraries \
$(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:
gmake -C ../UniversalDetector -f Makefile.linux
XADTest2: $(XADTEST2_OBJS) libXADMaster.a ../UniversalDetector/libUniversalDetector.a
$(LD) $(ALL_LDFLAGS) -o $@ $^ $(LIBS)
XADTest3: $(XADTEST3_OBJS) libXADMaster.a ../UniversalDetector/libUniversalDetector.a
$(LD) $(ALL_LDFLAGS) -o $@ $^ $(LIBS)
XADTest4: $(XADTEST4_OBJS) libXADMaster.a ../UniversalDetector/libUniversalDetector.a
$(LD) $(ALL_LDFLAGS) -o $@ $^ $(LIBS)
XADTest5: $(XADTEST5_OBJS) libXADMaster.a ../UniversalDetector/libUniversalDetector.a
$(LD) $(ALL_LDFLAGS) -o $@ $^ $(LIBS)
XADTest6: $(XADTEST6_OBJS) $(CMDLINE_OBJS) libXADMaster.a ../UniversalDetector/libUniversalDetector.a
$(LD) $(ALL_LDFLAGS) -o $@ $^ $(LIBS)
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)
gmake -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)