Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dependencies to inets Makefiles #9101

Open
wants to merge 1 commit into
base: maint
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/inets/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/deps/
28 changes: 27 additions & 1 deletion lib/inets/src/http_client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ ERL_FILES = $(MODULES:%=%.erl)

TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))

DEPDIR=deps
DEP_FILE=$(DEPDIR)/http_client.d
$(shell mkdir -p $(dir $(DEP_FILE)) >/dev/null)

ifeq ($(TARGET), win32)
# Native path without C: ignore driveletter case
ERL_TOP_NATIVE = $(shell w32_path.sh -m $(ERL_TOP) | sed "s@[a-zA-Z]:@:@")
else
ERL_TOP_NATIVE = $(ERL_TOP)
endif


# ----------------------------------------------------
# FLAGS
Expand All @@ -77,11 +88,14 @@ ERL_COMPILE_FLAGS += \
# Targets
# ----------------------------------------------------

$(TYPES): $(TARGET_FILES)
$(TYPES): $(TARGET_FILES) $(DEP_FILE)

deps: $(DEP_FILE)

clean:
rm -f $(TARGET_FILES)
rm -f core
rm -rf $(DEPDIR)

docs:

Expand All @@ -104,5 +118,17 @@ info:
@echo "INETS_FLAGS = $(INETS_FLAGS)"
@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"

$(DEP_FILE): $(ERL_FILES)
@echo SED $(TARGET) $(ERL_TOP_NATIVE)
$(gen_verbose)erlc -M $(ERL_FILES) \
| perl -pe "s@ [a-zA-Z]?$(ERL_TOP_NATIVE)/(?:bootstrap/)?lib/([^/]+)@ ../../../\1@g" 2> /dev/null \
| sed "s/\.$(EMULATOR)/\.$$\(EMULATOR\)/" \
| sed 's@^httpc@$$(EBIN)/httpc@' \
> $(DEP_FILE)


# ----------------------------------------------------
# Dependencies
# ----------------------------------------------------
-include $(DEP_FILE)

29 changes: 28 additions & 1 deletion lib/inets/src/http_lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ ERL_FILES = $(MODULES:%=%.erl)

TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))

DEPDIR=deps
DEP_FILE=$(DEPDIR)/http_lib.d
$(shell mkdir -p $(dir $(DEP_FILE)) >/dev/null)

ifeq ($(TARGET), win32)
# Native path without C: ignore driveletter case
ERL_TOP_NATIVE = $(shell w32_path.sh -m $(ERL_TOP) | sed "s@[a-zA-Z]:@:@")
else
ERL_TOP_NATIVE = $(ERL_TOP)
endif


# ----------------------------------------------------
# FLAGS
Expand All @@ -73,11 +84,14 @@ ERL_COMPILE_FLAGS += \
# Targets
# ----------------------------------------------------

$(TYPES): $(TARGET_FILES)
$(TYPES): $(TARGET_FILES) $(DEP_FILE)

deps: $(DEP_FILE)

clean:
rm -f $(TARGET_FILES)
rm -f core
rm -rf $(DEPDIR)

docs:

Expand All @@ -101,4 +115,17 @@ info:
@echo "INETS_DEBUG = $(INETS_DEBUG)"
@echo "INETS_FLAGS = $(INETS_FLAGS)"
@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"
$(DEP_FILE): $(ERL_FILES)
@echo SED $(TARGET) $(ERL_TOP_NATIVE)
$(gen_verbose)erlc -M $(ERL_FILES) \
| perl -pe "s@ [a-zA-Z]?$(ERL_TOP_NATIVE)/(?:bootstrap/)?lib/([^/]+)@ ../../../\1@g" 2> /dev/null \
| sed "s/\.$(EMULATOR)/\.$$\(EMULATOR\)/" \
| sed 's@^http_@$$(EBIN)/http_@' \
> $(DEP_FILE)


# ----------------------------------------------------
# Dependencies
# ----------------------------------------------------
-include $(DEP_FILE)

31 changes: 30 additions & 1 deletion lib/inets/src/http_server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ BEHAVIOUR_TARGET_FILES= $(BEHAVIOUR_MODULES:%=$(EBIN)/%.$(EMULATOR))

INETS_FLAGS = -D'SERVER_SOFTWARE="$(APPLICATION)/$(VSN)"'

DEPDIR=deps
DEP_FILE=$(DEPDIR)/http_server.d
$(shell mkdir -p $(dir $(DEP_FILE)) >/dev/null)

ifeq ($(TARGET), win32)
# Native path without C: ignore driveletter case
ERL_TOP_NATIVE = $(shell w32_path.sh -m $(ERL_TOP) | sed "s@[a-zA-Z]:@:@")
else
ERL_TOP_NATIVE = $(ERL_TOP)
endif


# ----------------------------------------------------
# FLAGS
Expand All @@ -117,11 +128,14 @@ ERL_COMPILE_FLAGS += \
# ----------------------------------------------------
$(TARGET_FILES): $(BEHAVIOUR_TARGET_FILES)

$(TYPES): $(TARGET_FILES)
$(TYPES): $(TARGET_FILES) $(DEP_FILE)

deps: $(DEP_FILE)

clean:
rm -f $(TARGET_FILES) $(BEHAVIOUR_TARGET_FILES)
rm -f core
rm -rf $(DEPDIR)

docs:

Expand All @@ -146,3 +160,18 @@ info:
@echo "INETS_FLAGS = $(INETS_FLAGS)"
@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"

$(DEP_FILE): $(ERL_FILES)
@echo SED $(TARGET) $(ERL_TOP_NATIVE)
$(gen_verbose)erlc -M $(ERL_FILES) \
| perl -pe "s@ [a-zA-Z]?$(ERL_TOP_NATIVE)/(?:bootstrap/)?lib/([^/]+)@ ../../../\1@g" 2> /dev/null \
| sed "s/\.$(EMULATOR)/\.$$\(EMULATOR\)/" \
| sed 's@^httpd@$$(EBIN)/httpd@' \
| sed 's@^mod_@$$(EBIN)/mod_@' \
> $(DEP_FILE)


# ----------------------------------------------------
# Dependencies
# ----------------------------------------------------
-include $(DEP_FILE)

31 changes: 30 additions & 1 deletion lib/inets/src/inets_app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ APP_TARGET = $(EBIN)/$(APP_FILE)
APPUP_SRC = $(APPUP_FILE).src
APPUP_TARGET = $(EBIN)/$(APPUP_FILE)

DEPDIR=deps
DEP_FILE=$(DEPDIR)/inets_app.d
$(shell mkdir -p $(dir $(DEP_FILE)) >/dev/null)

ifeq ($(TARGET), win32)
# Native path without C: ignore driveletter case
ERL_TOP_NATIVE = $(shell w32_path.sh -m $(ERL_TOP) | sed "s@[a-zA-Z]:@:@")
else
ERL_TOP_NATIVE = $(ERL_TOP)
endif


# ----------------------------------------------------
# FLAGS
Expand All @@ -86,11 +97,14 @@ ERL_COMPILE_FLAGS += \
# Targets
# ----------------------------------------------------

$(TYPES): $(TARGET_FILES)
$(TYPES): $(TARGET_FILES) $(DEP_FILE)

deps: $(DEP_FILE)

clean:
rm -f $(TARGET_FILES)
rm -f core
rm -rf $(DEPDIR)

docs:

Expand Down Expand Up @@ -127,3 +141,18 @@ info:
@echo "INETS_DEBUG = $(INETS_DEBUG)"
@echo "INETS_FLAGS = $(INETS_FLAGS)"
@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"

$(DEP_FILE): $(ERL_FILES)
@echo SED $(TARGET) $(ERL_TOP_NATIVE)
$(gen_verbose)erlc -M $(ERL_FILES) \
| perl -pe "s@ [a-zA-Z]?$(ERL_TOP_NATIVE)/(?:bootstrap/)?lib/([^/]+)@ ../../../\1@g" 2> /dev/null \
| sed "s/\.$(EMULATOR)/\.$$\(EMULATOR\)/" \
| sed 's@^inets@$$(EBIN)/inets@' \
> $(DEP_FILE)


# ----------------------------------------------------
# Dependencies
# ----------------------------------------------------
-include $(DEP_FILE)

Loading