Skip to content

Commit

Permalink
Simplify flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Florents-Tselai committed Feb 29, 2024
1 parent cd06132 commit 3249167
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ SRC=litejq.c
OUT=litejq
PKG_CONFIG ?= pkg-config

ifeq (no,$(shell $(PKG_CONFIG) libjq || echo no))
$(warning "libjq not registed with pkg-config, build might fail. If it does, try setting JQ_PREFIX manually and run with `JQ_PREFIX=/path/to/dir make all`")
LIBJQ_LIBS=-I$(JQ_PREFIX)/include -L$(JQ_PREFIX)/lib -ljq
else
LIBJQ_LIBS=$(shell $(PKG_CONFIG) --cflags --libs libjq)
endif
LIBJQ_FLAGS=$(shell $(PKG_CONFIG) --cflags --libs libjq)

SQLITE3_LIBS=$(shell $(PKG_CONFIG) --cflags --libs sqlite3)
SQLITE3_FLAGS=$(shell $(PKG_CONFIG) --cflags --libs sqlite3)

all: $(OUT)

$(OUT): $(SRC)
$(CC) $(CFLAGS) -o $(OUT) $(SRC) $(SQLITE3_LIBS) $(LIBJQ_LIBS)
$(CC) $(CFLAGS) -o $(OUT) $(SRC) $(SQLITE3_FLAGS) $(LIBJQ_FLAGS)

.PHONY: run-test-%
run-test-%:
Expand Down

0 comments on commit 3249167

Please sign in to comment.