Skip to content

Commit

Permalink
Add dependencies to inets
Browse files Browse the repository at this point in the history
  • Loading branch information
dotsimon committed Nov 22, 2024
1 parent dbbcc28 commit 6b08376
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 4 deletions.
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)

0 comments on commit 6b08376

Please sign in to comment.