1
0
mirror of synced 2025-01-31 12:03:42 +01:00
lindbergh-loader/Makefile

63 lines
2.3 KiB
Makefile
Raw Normal View History

2024-12-23 14:41:01 +00:00
CC = gcc -m32 -pthread
CFLAGS = -g -fPIC -m32 -Wall -Werror -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -D_GNU_SOURCE -Wno-char-subscripts
2025-01-08 17:23:53 +00:00
LD = gcc -m32
LDFLAGS = -Wl,-z,defs -rdynamic -static-libgcc -lc -ldl -lGL -lglut -lX11 -lSDL2 -lm -lpthread -shared -nostdlib -lasound -L./src/libxdiff -lxdiff
2022-07-07 13:34:29 +01:00
BUILD = build
2024-12-23 14:41:01 +00:00
XDIFF_SRCS = xdiffi.c xprepare.c xpatchi.c xmerge3.c xemit.c xmissing.c xutils.c \
xadler32.c xbdiff.c xbpatchi.c xversion.c xalloc.c xrabdiff.c
XDIFF_OBJS = $(patsubst %.c,src/libxdiff/xdiff/%.o,$(XDIFF_SRCS))
2022-07-07 13:34:29 +01:00
OBJS := $(patsubst %.c,%.o,$(wildcard src/lindbergh/*.c))
2024-12-23 14:41:01 +00:00
OBJS := $(filter-out src/lindbergh/lindbergh.o, $(OBJS))
all: lindbergh libxdiff.a lindbergh.so libsegaapi.so libkswapapi.so libposixtime.so
2022-07-07 13:34:29 +01:00
lindbergh: src/lindbergh/lindbergh.c src/lindbergh/log.c src/lindbergh/log.h src/lindbergh/jvs.c src/lindbergh/jvs.h src/lindbergh/config.h src/lindbergh/config.c src/lindbergh/evdevinput.h src/lindbergh/evdevinput.c
2024-12-23 14:41:01 +00:00
mkdir -p $(BUILD)
$(CC) src/lindbergh/lindbergh.c src/lindbergh/log.h src/lindbergh/log.c src/lindbergh/jvs.h src/lindbergh/jvs.c src/lindbergh/config.h src/lindbergh/config.c src/lindbergh/evdevinput.c src/lindbergh/evdevinput.h -o $(BUILD)/lindbergh -lm
2023-12-28 21:56:37 +00:00
2024-12-23 14:41:01 +00:00
libxdiff.a: $(XDIFF_OBJS)
2023-12-28 21:56:37 +00:00
mkdir -p $(BUILD)
2024-12-23 14:41:01 +00:00
ar rcs src/libxdiff/libxdiff.a $(XDIFF_OBJS)
src/libxdiff/xdiff/%.o: src/libxdiff/xdiff/%.c
$(CC) -DHAVE_CONFIG_H -fPIC -c $< -o $@
2022-07-07 13:34:29 +01:00
lindbergh.so: $(OBJS)
mkdir -p $(BUILD)
2024-12-23 14:41:01 +00:00
$(LD) $(OBJS) $(LDFLAGS) -o $(BUILD)/lindbergh.so
2022-07-07 13:34:29 +01:00
2024-12-23 14:41:01 +00:00
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
2022-07-28 12:43:10 +01:00
2024-12-23 14:41:01 +00:00
libsegaapi.so: src/libsegaapi/libsegaapi.o
gcc -m32 -O0 -g src/libsegaapi/libsegaapi.c -lFAudio -fPIC -shared -o $(BUILD)/libsegaapi.so
2022-07-28 12:43:10 +01:00
2023-07-06 23:09:38 +01:00
libkswapapi.so: src/libkswapapi/libkswapapi.o
2024-12-23 14:41:01 +00:00
$(CC) src/libkswapapi/libkswapapi.o -fPIC -shared -o $(BUILD)/libkswapapi.so
libposixtime.so:
$(CC) src/libposixtime/libposixtime.c src/libposixtime/libposixtime.h -m32 -shared -o $(BUILD)/libposixtime.so
ln -s -f libposixtime.so $(BUILD)/libposixtime.so.1
ln -s -f libposixtime.so $(BUILD)/libposixtime.so.2.4
2023-07-06 23:09:38 +01:00
2024-12-23 14:41:01 +00:00
# Clean rule
2022-07-07 13:34:29 +01:00
clean:
2024-12-23 14:41:01 +00:00
rm -f $(BUILD)/lindbergh.so
rm -f $(BUILD)/libsegaapi.so
rm -f $(BUILD)/lindbergh
rm -f src/lindbergh/*.o
rm -f src/libsegaapi/*.o
#clean all rule
cleanall:
2022-07-07 13:34:29 +01:00
rm -rf $(BUILD)
2023-12-12 15:27:37 +00:00
rm -f src/lindbergh/*.o
rm -f src/libsegaapi/*.o
2023-12-28 21:56:37 +00:00
rm -f src/libkswapapi/*.o
2024-12-23 14:41:01 +00:00
rm -f src/libxdiff/*.a
rm -f src/libxdiff/xdiff/*.o