-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
47 lines (37 loc) · 1.23 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
# Compiler settings
ifeq ($(UNAME_S),Linux)
CXX = g++
LIBS = -lXPLM -lXPWidgets -lGL -lglut
TARGET = linux.xpl
CXXFLAGS = -std=c++17 -Wall -Wextra -pedantic -O3 -Wno-extra-qualification -DLIN=1 -DXPLM200 -DXPLM300 -DXPLM301
else
CXX = clang++
LIBS = -framework XPLM -framework XPWidgets
TARGET = mac.xpl
CXXFLAGS = -std=c++17 -Wall -Wextra -pedantic -O3 -Wno-extra-qualification -DAPL=1 -DIBM=1 -DXPLM200 -DXPLM300 -DXPLM301
FRAMEWORK_DIRS = -F./lib/SDK/Libraries/Mac
endif
# Include and library paths
INCLUDE_DIRS = -I/usr/include -I./include -I./lib/SDK/CHeaders/XPLM -I./lib/mavlink/c_library_v2/all -I./lib/simpleini -I./lib/Eigen
LIBRARY_DIRS = -L./lib
FRAMEWORK_DIRS = -F./lib/SDK/Libraries/Mac
# Source files
SRCS = src/ConfigManager.cpp \
src/configReader.cpp \
src/ConnectionManager.cpp \
src/DataRefManager.cpp \
src/MAVLinkManager.cpp \
src/px4xplane.cpp
# Object files
OBJS = $(SRCS:.cpp=.o)
# Output file
TARGET = mac.xpl
# Rules
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -dynamiclib -o $@ $^ $(LIBRARY_DIRS) $(FRAMEWORK_DIRS) -framework XPLM
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $< $(INCLUDE_DIRS)
clean:
rm -f $(OBJS) $(TARGET)
.PHONY: all clean