makefiles: build subdirs (Thanks Kacper)
This commit is contained in:
parent
1a3f4c2f7d
commit
6a07e08320
22
Makefile
22
Makefile
|
@ -18,14 +18,25 @@ else
|
|||
UNUSED:=$(shell $(MAKE) loglevels.h)
|
||||
endif
|
||||
|
||||
SUBDIRS=i3-msg i3-input i3-nagbar i3-config-wizard
|
||||
|
||||
# Depend on the specific file (.c for each .o) and on all headers
|
||||
src/%.o: src/%.c ${HEADERS}
|
||||
echo "CC $<"
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="((uint64_t)1 << $(shell awk '/$(shell basename $< .c)/ { print NR; exit 0; }' loglevels.tmp))" -c -o $@ $<
|
||||
|
||||
all: src/cfgparse.y.o src/cfgparse.yy.o src/cmdparse.y.o src/cmdparse.yy.o ${FILES}
|
||||
all: i3 subdirs
|
||||
|
||||
i3: src/cfgparse.y.o src/cfgparse.yy.o src/cmdparse.y.o src/cmdparse.yy.o ${FILES}
|
||||
echo "LINK i3"
|
||||
$(CC) $(LDFLAGS) -o i3 $^ $(LIBS)
|
||||
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
subdirs:
|
||||
for dir in $(SUBDIRS); do \
|
||||
echo ""; \
|
||||
echo "MAKE $$dir"; \
|
||||
$(MAKE) -C $$dir; \
|
||||
done
|
||||
|
||||
loglevels.h:
|
||||
echo "LOGLEVELS"
|
||||
|
@ -74,10 +85,9 @@ install: all
|
|||
$(INSTALL) -m 0644 i3.welcome $(DESTDIR)$(SYSCONFDIR)/i3/welcome
|
||||
$(INSTALL) -m 0644 i3.desktop $(DESTDIR)$(PREFIX)/share/xsessions/
|
||||
$(INSTALL) -m 0644 include/i3/ipc.h $(DESTDIR)$(PREFIX)/include/i3/
|
||||
$(MAKE) TOPDIR=$(TOPDIR) -C i3-msg install
|
||||
$(MAKE) TOPDIR=$(TOPDIR) -C i3-input install
|
||||
$(MAKE) TOPDIR=$(TOPDIR) -C i3-nagbar install
|
||||
$(MAKE) TOPDIR=$(TOPDIR) -C i3-config-wizard install
|
||||
for dir in $(SUBDIRS); do \
|
||||
$(MAKE) -C $$dir install; \
|
||||
done
|
||||
|
||||
dist: distclean
|
||||
[ ! -d i3-${VERSION} ] || rm -rf i3-${VERSION}
|
||||
|
|
|
@ -13,9 +13,11 @@ HEADERS:=$(wildcard *.h)
|
|||
echo "CC $<"
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
all: cfgparse.y.o cfgparse.yy.o ${FILES}
|
||||
all: i3-config-wizard
|
||||
|
||||
i3-config-wizard: cfgparse.y.o cfgparse.yy.o ${FILES}
|
||||
echo "LINK i3-config-wizard"
|
||||
$(CC) $(LDFLAGS) -o i3-config-wizard $^ $(LIBS)
|
||||
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS}
|
||||
echo "LEX $<"
|
||||
|
|
|
@ -12,9 +12,11 @@ HEADERS=$(wildcard *.h)
|
|||
echo "CC $<"
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
all: ${FILES}
|
||||
all: i3-input
|
||||
|
||||
i3-input: ${FILES}
|
||||
echo "LINK i3-input"
|
||||
$(CC) $(LDFLAGS) -o i3-input ${FILES} $(LIBS)
|
||||
$(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
|
||||
|
||||
install: all
|
||||
echo "INSTALL"
|
||||
|
|
|
@ -14,7 +14,9 @@ HEADERS=$(wildcard *.h)
|
|||
echo "CC $<"
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
all: ${FILES}
|
||||
all: i3-msg
|
||||
|
||||
i3-msg: ${FILES}
|
||||
echo "LINK i3-msg"
|
||||
$(CC) $(LDFLAGS) -o i3-msg ${FILES} $(LIBS)
|
||||
|
||||
|
|
|
@ -12,9 +12,11 @@ HEADERS=$(wildcard *.h)
|
|||
echo "CC $<"
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
all: ${FILES}
|
||||
all: i3-nagbar
|
||||
|
||||
i3-nagbar: ${FILES}
|
||||
echo "LINK i3-nagbar"
|
||||
$(CC) $(LDFLAGS) -o i3-nagbar ${FILES} $(LIBS)
|
||||
$(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
|
||||
|
||||
install: all
|
||||
echo "INSTALL"
|
||||
|
|
Loading…
Reference in New Issue