2025-12-22 18:22:46 +09:00
|
|
|
CC = gcc
|
2025-12-22 19:20:04 +09:00
|
|
|
CFLAGS = -I include -fPIC -g
|
2025-12-22 18:22:46 +09:00
|
|
|
LDFLAGS = -shared
|
|
|
|
|
LIBS =
|
|
|
|
|
|
2025-12-23 00:32:53 +09:00
|
|
|
OBJS = src/core.o src/file.o src/unicode.o src/util.o src/array.o
|
2025-12-22 18:22:46 +09:00
|
|
|
|
|
|
|
|
SO = .so
|
|
|
|
|
|
|
|
|
|
.PHONY: all format clean
|
|
|
|
|
.SUFFIXES: .c .o
|
|
|
|
|
|
2025-12-23 02:05:29 +09:00
|
|
|
all: libxemil$(SO)
|
2025-12-22 18:22:46 +09:00
|
|
|
|
|
|
|
|
format:
|
2025-12-22 18:52:37 +09:00
|
|
|
clang-format --verbose -i `find src include -name "*.c" -or -name "*.h"` example.c
|
2025-12-22 18:22:46 +09:00
|
|
|
|
2025-12-23 02:05:29 +09:00
|
|
|
example: example.c libxemil$(SO)
|
|
|
|
|
$(CC) -o $@ example.c -I include -Wl,-R. -L. -lxemil
|
2025-12-22 18:22:46 +09:00
|
|
|
|
2025-12-23 02:05:29 +09:00
|
|
|
libxemil$(SO): $(OBJS)
|
2025-12-22 18:22:46 +09:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
|
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
|
|
clean:
|
2025-12-22 19:20:04 +09:00
|
|
|
rm -f src/*.o *.so *.dll example
|