Commit e4a41e8c authored by Kinsbursky Stanislav's avatar Kinsbursky Stanislav Committed by Pavel Emelyanov

make: prepare crtools build for submake calls

The reason for this patch is that only phony goal can depend on phony targets.
But with protobuf we will have to execute phony targets prior to main target
build.
So, this patch set add few new goals and dependences:

1) "all" become default goal.
2) new goals "deps" and "preq" introduced.
3) "all" depends on "deps" and "crtools".
4) All global goals like "zdtm" and "test-legacy" now depends on "all".
Signed-off-by: 's avatarStanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent c2e69998
......@@ -61,9 +61,14 @@ DEPS := $(patsubst %.o,%.d,$(OBJS))
include Makefile.syscall
include Makefile.pie
.PHONY: all test-legacy zdtm test rebuild clean distclean tags cscope docs help
.PHONY: all test-legacy zdtm test rebuild clean distclean tags cscope \
docs help deps preq
all: $(PROGRAM)
all: deps $(PROGRAM)
deps: preq $(DEPS)
preq: $(SYS-OBJ) $(PIE-GEN)
%.o: %.c
$(E) " CC " $@
......@@ -87,10 +92,10 @@ $(PROGRAM): $(OBJS)
$(E) " LINK " $@
$(Q) $(CC) $(CFLAGS) $(OBJS) $(LIBS) $(SYS-OBJ) -o $@
test-legacy: $(PROGRAM)
test-legacy: all
$(Q) $(MAKE) -C test/legacy all
zdtm: $(PROGRAM)
zdtm: all
$(Q) $(MAKE) -C test/zdtm all
test: zdtm
......@@ -150,7 +155,7 @@ help:
deps-targets := $(OBJS) $(patsubst %.o,%.s,$(OBJS)) $(patsubst %.o,%.i,$(OBJS)) $(PROGRAM) zdtm test-legacy
.DEFAULT_GOAL := $(PROGRAM)
.DEFAULT_GOAL := all
ifneq ($(filter $(deps-targets), $(MAKECMDGOALS)),)
INCDEPS := 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment