jw-pkg/make/targets-tools.mk
Jan Lindemann f9d398d219 make: Fix MinGW build machinery machinery
This commit makes it possible to successfully run "make all" against ytools'
again, with TARGET_TUPLE set to i686-ms-w64-mingw. Lots of minor and major
tweaks here and there.

The biggest diff is a move of the architecture-related definitions into
platform.mk. The are needed pretty early on, so that seems reasonable.

Making this work again is part of the larger effort to support cross
buildchains in a more concise way, i.e. without so many if ($(TARGET),mingw))
all over the place. TARGET's relevance should dwindle, until it's finally taken
over by the TARGET_XXX variables extracted from TARGET_TUPLE or TARGET_TRIPLET.

Signed-off-by: Jan Lindemann <jan@janware.com>
2019-03-02 17:21:48 +00:00

56 lines
1.2 KiB
Makefile

# generic utility modules
# (c) 2001 jannet it services
# contact@jannet.de
# $Id$
ifndef TARGETS_TOOLS_MK_INCLUDED
TARGETS_TOOLS_MK_INCLUDED = true
include $(MODDIR)/make/rules.mk
ifneq ($(strip $(SRC_ALL_CPP)),)
# mandatory targets
all:
# all.link
install: $(ALL)
# convenience targets
#link: all.link
clean-link: clean.link
#all.link: $(HDRDIR_SCOPE_SUFFIX)
$(HDRDIR_SCOPE_SUFFIX):
mkdir -p $(dir $(HDRDIR_SCOPE_SUFFIX))
ln -s $(shell realpath -m . --relative-to $(dir $(HDRDIR_SCOPE_SUFFIX))) $@
ifeq ($(SCOPE_PREFIX),)
#all.link: $(BUILD_HDRDIR)/$(HDRDIR_SCOPE_SUFFIX)
#$(BUILD_HDRDIR)/$(HDRDIR_SCOPE_SUFFIX):
# cd $(BUILD_HDRDIR_BASE) && ln -s . $(HDRDIR_SCOPE_SUFFIX)
endif
ifneq ($(TARGET),mingw)
$(LIB_SO): $(OBJ)
endif
all.done: $(PREREQ_DONE) $(BUILD_HDR) $(BUILD_EXE_SH) $(MEMBERS) $(LIB_A) | $(HDRDIR_SCOPE_SUFFIX)
ifneq ($(TARGET),mingw)
all.done: $(LIB_SO)
endif
endif
clean: objclean textclean localclean profclean clean.link
clean.link:
if [ -L "$(HDRDIR_SCOPE_SUFFIX)" -a "`realpath --relative-to . $(HDRDIR_SCOPE_SUFFIX) 2>/dev/null`" = . ]; then \
rm $(HDRDIR_SCOPE_SUFFIX) ;\
rmdir -p $(dir $(HDRDIR_SCOPE_SUFFIX)) 2>/dev/null || : ;\
fi
endif # ifndef TARGETS_TOOLS_MK_INCLUDED