1
0
mirror of synced 2024-11-14 14:47:35 +01:00
lindbergh-loader/Makefile
Bobby Dilley c2e29d9e26 Refactor
2023-12-12 15:27:37 +00:00

31 lines
1013 B
Makefile

CC=gcc -m32
CFLAGS = -g -O0 -fPIC -m32 -Wall -Werror -Wno-unused-variable -Wno-unused-function
LD = g++ -m32
LDFLAGS = -Wl,-z,defs -rdynamic -static-libstdc++ -static-libgcc -lc -ldl -lGL -lglut -lX11 -lm -lpthread -shared -nostdlib
BUILD = build
OBJS := $(patsubst %.c,%.o,$(wildcard src/lindbergh/*.c))
all: lindbergh.so libsegaapi.so libkswapapi.so
lindbergh.so: $(OBJS)
mkdir -p $(BUILD)
$(LD) $(OBJS) $(LDFLAGS) $(CFLAGS) -o $(BUILD)/lindbergh.so
rm -f src/lindbergh/*.o
LIBSEGA_LD=gcc #clang
LIBSEGA_LDFLAGS=-m32 -O0 -g
libsegaapi.so: src/libsegaapi/segaapi.o
$(LIBSEGA_LD) $(LIBSEGA_LDFLAGS) src/libsegaapi/segaapi.o -L/usr/lib/i386-linux-gnu -lalut -fPIC -shared -o $(BUILD)/libsegaapi.so
rm -f src/libsegaapi/*.o
libkswapapi.so: src/libkswapapi/libkswapapi.o
$(LIBSEGA_LD) $(LIBSEGA_LDFLAGS) src/libkswapapi/libkswapapi.o -L/usr/lib/i386-linux-gnu -fPIC -shared -o $(BUILD)/libkswapapi.so
clean:
rm -rf $(BUILD)
rm -f src/lindbergh/*.o
rm -f src/libsegaapi/*.o
rm -f src/libkswapapi/*.o