Skip to content

Commit

Permalink
make it compile on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
hotbso committed Sep 25, 2022
1 parent 9efce80 commit eb1bef3
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions Makefile.lin64
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
PLUGINS=../X-Plane/Resources/plugins/xgs
SDK=../SDK
ACFUT=../libacfutils-redist
OBJDIR=./OBJ

LIBACFUTILS_VERSION="hotbso subset"
TARGET=win.xpl
TARGET=lin.xpl
HEADERS=$(wildcard *.h)
SOURCES=$(wildcard *.c)
OBJECTS=$(SOURCES:.c=.o)
OBJECTS=$(addprefix $(OBJDIR)/, $(SOURCES:.c=.o))

CFLAGS=-Wall -I$(SDK)/CHeaders/XPLM -I$(SDK)/CHeaders/Widgets -I$(ACFUT)/include -DLIN=1 -fPIC -fno-stack-protector \
LACFU_SOURCES=$(wildcard libacfutils/src/*.c)
LACFU_OBJECTS=$(addprefix $(OBJDIR)/, $(notdir $(LACFU_SOURCES:.c=.o)))

COMMON_CFLAGS=-Wall -I$(SDK)/CHeaders/XPLM -I$(SDK)/CHeaders/Widgets -Ilibacfutils/src -fPIC -DLIN=1 -fno-stack-protector \
-DXPLM200 -DXPLM210 -DXPLM300 -DXPLM301
CFLAGS=$(COMMON_CFLAGS)
LACFU_CFLAGS=-fvisibility=hidden -DLIBACFUTILS_VERSION='$(LIBACFUTILS_VERSION)' $(COMMON_CFLAGS)


LNFLAGS=-shared -rdynamic -nodefaultlibs -undefined_warning
LIBS=-L$(ACFUT)/lin64/lib -lacfutils
#-fvisibility=hidden -Wl,-exported_symbols_list -Wl,linkscript.mac
LIBS=-L$(ACFUT)/lin64/lib

all: $(TARGET)
$(shell [ -d $(OBJDIR) ] || mkdir $(OBJDIR))

$(OBJDIR)/%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<

$(OBJDIR)/%.o: libacfutils/src/%.c
$(CC) $(LACFU_CFLAGS) -o $@ -c $<

.c.o:
$(CC) $(CFLAGS) -c $<

$(TARGET): $(OBJECTS)
$(CC) -o $(TARGET) $(LNFLAGS) $(OBJECTS) $(LIBS)
$(TARGET): $(OBJECTS) $(LACFU_OBJECTS)
$(CC) -o $(TARGET) $(LNFLAGS) $(OBJECTS) $(LACFU_OBJECTS) $(LIBS)

clean:
rm -f $(OBJECTS) $(TARGET)
rm -f $(OBJECTS) $(LACFU_OBJECTS) $(TARGET)

install: $(TARGET)
cp -p $(TARGET) $(PLUGINS)/64
Expand Down

0 comments on commit eb1bef3

Please sign in to comment.