-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.lin64
48 lines (33 loc) · 1.28 KB
/
Makefile.lin64
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
PLUGINS=../../../X-Plane-12/Resources/plugins/AutoDGS
include version.mak
SDK=../SDK
OBJDIR=./OBJ_lx
LIBACFUTILS_VERSION="hotbso subset"
TARGET=$(OBJDIR)/lin.xpl
HEADERS=$(wildcard *.h)
SOURCES_C=$(wildcard *.c)
SOURCES_CPP=$(wildcard *.cpp)
OBJECTS_=$(SOURCES_C:.c=.o) $(SOURCES_CPP:.cpp=.o)
LACFU_SOURCES=$(wildcard libacfutils/src/*.c)
LACFU_OBJECTS=$(addprefix $(OBJDIR)/, $(notdir $(LACFU_SOURCES:.c=.o)))
COMMON_CFLAGS=-DVERSION=\"$(VERSION)\" \
-Wall -I. -I$(SDK)/CHeaders/XPLM -I$(SDK)/CHeaders/Widgets -Ilibacfutils/src -fPIC -DLIN=1 -fno-stack-protector
CFLAGS=$(COMMON_CFLAGS)
LACFU_CFLAGS=-fvisibility=hidden -DLIBACFUTILS_VERSION='$(LIBACFUTILS_VERSION)' $(COMMON_CFLAGS)
OBJECTS=$(addprefix $(OBJDIR)/, $(OBJECTS_))
$(info $(OBJECTS))
LNFLAGS=-shared -rdynamic -nodefaultlibs -undefined_warning
all: $(TARGET)
$(shell [ -d $(OBJDIR) ] || mkdir $(OBJDIR))
$(OBJDIR)/%.o: %.c version.mak $(HEADERS)
$(CC) $(CFLAGS) -o $@ -c $<
$(OBJDIR)/%.o: %.cpp version.mak $(HEADERS)
$(CC) $(CFLAGS) -o $@ -c $<
$(OBJDIR)/%.o: libacfutils/src/%.c
$(CC) $(LACFU_CFLAGS) -o $@ -c $<
$(TARGET): $(OBJECTS) $(LACFU_OBJECTS)
g++ -o $(TARGET) $(LNFLAGS) $(OBJECTS) $(LACFU_OBJECTS)
clean:
rm -f $(OBJECTS) $(LACFU_OBJECTS) $(TARGET)
install: $(TARGET)
cp -p $(TARGET) $(PLUGINS)/64