Commit 70f32cc3 authored by Thaodan's avatar Thaodan

Merge branch 'jb52244' into 'master'

[sb2] Fix make depency graph resolving. Fixes JB#52244

See merge request !44
parents d93761c9 b9cd834a
......@@ -44,6 +44,7 @@ define import_dir
objects :=
objects-y :=
D := $(1)
$(shell -p mkdir $(1))
include $(1)/Makefile
dep_files := $$(wildcard $(1)/.*.d)
include $(dep_files)
......@@ -59,7 +60,6 @@ $(foreach dir,$(subdirs),$(eval $(call import_dir,$(dir))))
all_objects += $(foreach t,$(extra_targets),$($(t)))
MKOUTPUTDIR = @mkdir -p $(dir $@)
ifdef V
Q =
......@@ -70,42 +70,34 @@ Q = @
endif
%.dylib:
$(MKOUTPUTDIR)
$(P)DYLIB
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -dynamiclib -o $@ $^ $(LIBS)
%.so::
$(MKOUTPUTDIR)
$(P)SHLIB
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(LIBS)
%.a::
$(MKOUTPUTDIR)
$(P)ARCHIVE
$(Q)$(CC) $(LDFLAGS) -r -nostdlib -nodefaultlibs -nostartfiles -o $@ $^
built-in.o:: %.o
$(MKOUTPUTDIR)
$(P)BUILTIN
$(Q)$(CC) -r -nostdlib -nodefaultlibs -nostartfiles -o $@ $^
%.o:: %.S
$(MKOUTPUTDIR)
$(P)AS
$(Q)$(CC) $(CFLAGS) -D__ASSEMBLY__ -Wp,-MT,$@ -Wp,-MMD,$(dir $@).$(notdir $@).d -o $@ -c $<
%.o:: %.c
$(MKOUTPUTDIR)
$(P)CC
$(Q)$(CC) $(CFLAGS) -Wp,-MT,$@ -Wp,-MMD,$(dir $@).$(notdir $@).d -o $@ -c $<
%.o:: %.cc
$(MKOUTPUTDIR)
$(P)CXX
$(Q)$(CXX) $(CFLAGS) $(CXXFLAGS) -Wp,-MT,$@ -Wp,-MMD,$(dir $@)/.$(notdir $@).d -o $@ -c $<
%.o:: %.cpp
$(MKOUTPUTDIR)
$(P)CXX
$(Q)$(CXX) $(CFLAGS) $(CXXFLAGS) -Wp,-MT,$@ -Wp,-MMD,$(dir $@)/.$(notdir $@).d -o $@ -c $<
......
......@@ -18,7 +18,7 @@ $(D)/sb2-ruletree: CFLAGS := $(CFLAGS) -Wall -W $(WERROR) \
-I$(SRCDIR)/include
$(D)/sb2-ruletree.o: preload/exported.h
$(D)/sb2-ruletree: $(D)/sb2-ruletree.o $(D)/../rule_tree/rule_tree.o
$(D)/sb2-ruletree: $(D)/sb2-ruletree.o rule_tree/rule_tree.o
$(MKOUTPUTDIR)
$(P)LD
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -ldl
......
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