options:
@echo "vimb build options:"
- @echo "LIBS = $(LIBS)"
- @echo "CFLAGS = $(VIMB_CFLAGS)"
- @echo "LDFLAGS = $(VIIMB_LDFLAGS)"
- @echo "EXT_CFLAGS = $(EXT_CFLAGS)"
- @echo "EXT_LDFLAGS = $(EXT_LDFLAGS)"
- @echo "CC = $(CC)"
+ @echo "LIBS = $(LIBS)"
+ @echo "CFLAGS = $(CFLAGS)"
+ @echo "LDFLAGS = $(LDFLAGS)"
+ @echo "EXTCFLAGS = $(EXTCFLAGS)"
+ @echo "CC = $(CC)"
install: $(SRCDIR).subdir-all
@# binary
# setup general used CFLAGS
CFLAGS += -std=c99 -pipe -Wall
-
#CPPFLAGS += -pedantic
CPPFLAGS += -DVERSION=\"${VERSION}\" -DEXTENSIONDIR=\"${EXTENSIONDIR}\" -DCOMMIT=\"$(COMMIT)\"
CPPFLAGS += -DPROJECT=\"vimb\" -DPROJECT_UCFIRST=\"Vimb\"
# flags used to build webextension
EXTTARGET = webext_main.so
-EXT_CFLAGS = -fPIC $(shell pkg-config --cflags webkit2gtk-4.0) $(CPPFLAGS) $(CFLAGS)
-EXT_LDFLAGS = $(shell pkg-config --libs webkit2gtk-4.0) -shared $(LDFLAGS)
+EXTCFLAGS = ${CFLAGS} -fPIC $(shell pkg-config --cflags webkit2gtk-4.0)
+EXTCPPFLAGS = $(CPPFLAGS)
+EXTLDFLAGS = $(shell pkg-config --libs webkit2gtk-4.0) -shared
# flags used for the main application
-VIMB_CFLAGS = $(shell pkg-config --cflags $(LIBS)) $(CPPFLAGS) $(CFLAGS)
-VIMB_LDFLAGS = $(shell pkg-config --libs $(LIBS)) $(LDFLAGS)
+CFLAGS += $(shell pkg-config --cflags $(LIBS))
+LDFLAGS += $(shell pkg-config --libs $(LIBS))
vimb: $(OBJ)
@echo "${CC} $@"
- $(Q)$(CC) $(OBJ) $(VIMB_LDFLAGS) -o $@
+ $(Q)$(CC) $(OBJ) $(LDFLAGS) -o $@
$(OBJ): config.h $(BASEDIR)/config.mk
%.o: %.c
@echo "${CC} $@"
- $(Q)$(CC) $(VIMB_CFLAGS) -c -o $@ $<
+ $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
%.subdir-all: config.h
$(Q)$(MAKE) -C $*
$(EXTTARGET): $(OBJ)
@echo "$(CC) $@"
- $(Q)$(CC) $(OBJ) $(EXT_LDFLAGS) -o $@
+ $(Q)$(CC) $(OBJ) $(EXTLDFLAGS) -o $@
%.lo: %.c
@echo "${CC} $@"
- $(Q)$(CC) $(EXT_CFLAGS) -fPIC -c -o $@ $<
+ $(Q)$(CC) $(EXTCPPFLAGS) $(EXTCFLAGS) -fPIC -c -o $@ $<
.PHONY: all clean