Skip to content

Commit ba639cd

Browse files
committed
Revert makefile changes
This reverts commit 0f81b8e This reverts commit 8249be0 Issue is that it is creating object files in the source tree, rather than out of it.
1 parent 5453664 commit ba639cd

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

Makefile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
SRC = sqlite3/sqlite3.c c_src/sqlite3_nif.c
2-
OBJ = $(SRC:.c=.o)
32

43
CFLAGS ?= -g
54

@@ -45,33 +44,30 @@ PRIV_DIR = $(MIX_APP_PATH)/priv
4544
LIB_NAME = $(PRIV_DIR)/sqlite3_nif.so
4645

4746
ifneq ($(CROSSCOMPILE),)
48-
CFLAGS += -shared -fPIC -fvisibility=hidden
47+
LIB_CFLAGS := -shared -fPIC -fvisibility=hidden
4948
SO_LDFLAGS := -Wl,-soname,libsqlite3.so.0
5049
else
5150
ifeq ($(KERNEL_NAME), Linux)
52-
CFLAGS += -shared -fPIC -fvisibility=hidden
51+
LIB_CFLAGS := -shared -fPIC -fvisibility=hidden
5352
SO_LDFLAGS := -Wl,-soname,libsqlite3.so.0
5453
endif
5554
ifeq ($(KERNEL_NAME), Darwin)
56-
CFLAGS += -dynamiclib -undefined dynamic_lookup
55+
LIB_CFLAGS := -dynamiclib -undefined dynamic_lookup
5756
endif
5857
ifeq ($(KERNEL_NAME), $(filter $(KERNEL_NAME),OpenBSD FreeBSD NetBSD))
59-
CFLAGS += -shared -fPIC
58+
LIB_CFLAGS := -shared -fPIC
6059
endif
6160
endif
6261

63-
%.o: %.c
64-
$(CC) $(CFLAGS) -o $@ -c $<
65-
6662
all: $(PRIV_DIR) $(LIB_NAME)
6763

68-
$(LIB_NAME): $(OBJ)
69-
$(CC) $(CFLAGS) $(SO_LDFLAGS) $^ -o $@
64+
$(LIB_NAME): $(SRC)
65+
$(CC) $(CFLAGS) $(LIB_CFLAGS) $(SO_LDFLAGS) $^ -o $@
7066

7167
$(PRIV_DIR):
7268
mkdir -p $@
7369

7470
clean:
75-
rm -f $(LIB_NAME) $(OBJ)
71+
rm -f $(LIB_NAME)
7672

7773
.PHONY: all clean

0 commit comments

Comments
 (0)