include config.mk
-all: vimb
+all: $(SRCDIR)/vimb
options:
@echo "vimb build options:"
@echo "EXTCFLAGS = $(EXTCFLAGS)"
@echo "CC = $(CC)"
-vimb: $(SUBDIRS:%=%.subdir-all)
+$(SRCDIR)/vimb:
+ @$(MAKE) $(MFLAGS) -C $(SRCDIR)
-%.subdir-all:
- @$(MAKE) $(MFLAGS) -C $*
-
-%.subdir-clean:
- @$(MAKE) $(MFLAGS) -C $* clean
-
-install: vimb
+install: $(SRCDIR)/vimb
@# binary
install -d $(BINPREFIX)
install -m 755 $(SRCDIR)/vimb $(BINPREFIX)/vimb
uninstall:
$(RM) $(BINPREFIX)/vimb $(DESTDIR)$(MANDIR)/man1/vimb.1 $(EXTPREFIX)/$(EXTTARGET)
-clean: $(SUBDIRS:%=%.subdir-clean)
+clean:
+ @$(MAKE) $(MFLAGS) -C $(SRCDIR) clean
sandbox:
@make $(MFLAGS) RUNPREFIX=$(CURDIR)/sandbox/usr PREFIX=/usr DESTDIR=./sandbox install
runsandbox: sandbox
sandbox/usr/bin/vimb
-.PHONY: all options clean install uninstall sandbox sandbox-clean
+.PHONY: all vimb options clean install uninstall sandbox
# define some directories
SRCDIR = src
DOCDIR = doc
-SUBDIRS = $(SRCDIR)/scripts $(SRCDIR)/webextension $(SRCDIR)
# used libs
LIBS = gtk+-3.0 'webkit2gtk-4.0 >= 2.3.5'
BASEDIR=..
include $(BASEDIR)/config.mk
-OBJ = $(patsubst %.c, %.o, $(wildcard *.c))
+SUBDIRS = scripts webextension
+OBJ = $(patsubst %.c, %.o, $(wildcard *.c))
all: vimb
-clean:
+clean: $(SUBDIRS:%=%.subdir-clean)
$(RM) vimb *.o
-vimb: $(OBJ)
- $(CC) $(LDFLAGS) $^ -o $@
+vimb: $(OBJ) webextension.subdir-all
+ $(CC) $(LDFLAGS) $(OBJ) -o $@
-$(OBJ): config.h $(BASEDIR)/config.mk
+$(OBJ): scripts.subdir-all config.h $(BASEDIR)/config.mk
-include $(OBJ:.o=.d)
@echo "${CC} $@"
@$(CC) $(CFLAGS) -c -o $@ $<
+%.subdir-all: config.h
+ @$(MAKE) $(MFLAGS) -C $*
+
+%.subdir-clean:
+ @$(MAKE) $(MFLAGS) -C $* clean
+
.PHONY: all clean