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

memory-monitor: Add dist-tarball target to Makefile #4271

Merged
merged 1 commit into from
Sep 23, 2024
Merged
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
2 changes: 2 additions & 0 deletions pkg/memory-monitor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ zedbox
obj
bin
dist
dist-tar
results
memory-monitor.tar.bz2
13 changes: 12 additions & 1 deletion pkg/memory-monitor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ SRC_DIR=src
OBJ_DIR=obj
DIST_DIR=dist
BIN_DIR=bin
TAR_DIR=dist-tar
TARBALL=memory-monitor.tar.bz2

MONITOR_DIR=$(SRC_DIR)/monitor
MONITOR_SRC=$(wildcard $(MONITOR_DIR)/*.c)
Expand Down Expand Up @@ -56,8 +58,16 @@ dist: $(BIN_DIR)/memory-monitor $(MONITOR_DEPS)
cp $(BIN_DIR)/memory-monitor $(HANDLER_SCRIPT) $(CONFIG_FILE) $(APPARMOR_PROFILE) $(DIST_DIR)
@touch dist

dist-tarball: dist
@echo "Generating tarball $(TARBALL) ..."
@mkdir -p $(TAR_DIR)/persist/memory-monitor
@cp $(DIST_DIR)/* $(TAR_DIR)/persist/memory-monitor/
@tar -cvjf $(TARBALL) -C $(TAR_DIR)/ .
@rm -rf $(TAR_DIR)
@echo "Done."

dist-clean: clean
rm -rf $(DIST_DIR)
rm -rf $(DIST_DIR) $(TARBALL)

# Target for local testing

Expand Down Expand Up @@ -100,6 +110,7 @@ help:
@echo " all: Build all targets (monitor and pressure)"
@echo " clean: Remove all build artifacts"
@echo " dist: Create a directory with all distribution artifacts: monitor, handler.sh, monitor.conf, persist.memory-monitor.handler"
@echo " dist-tarball: Create a tarball that can be extracted direct on the EVE device"
@echo " dist-clean: Remove the distribution directory"
@echo " monitor: Build the monitor, put the binary in bin/monitor"
@echo " pressure: Build the pressure tool, put the binary in bin/pressure"
Expand Down
Loading