Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ GRAVITY_SRC = src/cli/gravity.c
EXAMPLE_SRC = examples/example.c

CC ?= gcc
AR ?= ar
RANLIB ?= ranlib
SRC = $(wildcard $(COMPILER_DIR)*.c) \
$(wildcard $(RUNTIME_DIR)*.c) \
$(wildcard $(SHARED_DIR)*.c) \
Expand All @@ -17,6 +19,8 @@ INCLUDE = -I$(COMPILER_DIR) -I$(RUNTIME_DIR) -I$(SHARED_DIR) -I$(UTILS_DIR) -I$(
CFLAGS = $(INCLUDE) -std=gnu99 -fgnu89-inline -fPIC -DBUILD_GRAVITY_API
OBJ = $(SRC:.c=.o)

SLIBTARGET=libgravity.a

ifeq ($(OS),Windows_NT)
# Windows
LIBTARGET = gravity.dll
Expand Down Expand Up @@ -67,7 +71,12 @@ example: $(OBJ) $(EXAMPLE_SRC)
lib: gravity
$(CC) -shared -o $(LIBTARGET) $(OBJ) $(LDFLAGS)

staticlib: gravity
$(AR) crs $(SLIBTARGET) $(OBJ)
$(RANLIB) $(SLIBTARGET)
# $(CC) -shared -o $(LIBTARGET) $(OBJ) $(LDFLAGS)

clean:
rm -f $(OBJ) gravity example libgravity.so gravity.dll
rm -f $(OBJ) gravity example $(LIBTARGET) $(SLIBTARGET) gravity.dll

.PHONY: all clean gravity example