khatus_sensor_volume \
khatus_sensor_weather
BASH_EXECUTABLES := $(foreach exe,$(BASH_EXECUTABLE_NAMES),bin/$(exe))
-OCAML_EXECUTABLES := \
- bin/khatus_cache_dumper
-EXECUTABLES := $(AWK_EXECUTABLES) $(BASH_EXECUTABLES) $(OCAML_EXECUTABLES)
+EXECUTABLES := $(AWK_EXECUTABLES) $(BASH_EXECUTABLES)
define BUILD_AWK_EXE
echo '#! $(PATH_TO_AWK) -f' > $@ && \
clean:
rm -rf bin
- ocamlbuild -clean
bin:
mkdir -p bin
src/awk/exe/parse_upower.awk \
src/awk/lib/msg.awk
$(BUILD_AWK_EXE)
-
-#-----------------------------------------------------------------------------
-# OCaml
-#-----------------------------------------------------------------------------
-bin/khatus_cache_dumper: src/ocaml/exe/khatus_cache_dumper.ml
- ocamlbuild -cflags '-w A' -pkg unix -I src/ocaml/exe -I src/ocaml/lib khatus_cache_dumper.byte
- mv _build/src/ocaml/exe/khatus_cache_dumper.byte bin/khatus_cache_dumper
- rm -f khatus_cache_dumper.byte
-v Status_Args='@energy_percent,@memory_percent,@processes_count_all,@processes_count_r,@processes_count_d,@processes_count_t,@processes_count_i,@processes_count_z,@cpu_loadavg,@cpu_temp,@cpu_fan_speed,@disk_space,@disk_io_w,@disk_io_r,@net_wifi:wlp4s0,@net_io_w:wlp4s0,@net_io_r:wlp4s0,@bluetooth_power,@backlight_percent,@volume:0,@mpd,@weather_temp_f,@datetime' \
) \
) \
- >(stdbuf -o L ./bin/khatus_cache_dumper $(hostname) 5 "$PWD/data") \
>(stdbuf -o L ./bin/khatus_monitor_energy) \
>(stdbuf -o L ./bin/khatus_monitor_errors) \
>(stdbuf -o L ./bin/khatus_monitor_devices) \
--- /dev/null
+MAKEFLAGS := --no-builtin-rules
+
+PREFIX := $(HOME)
+EXE_NAME := khatus_cache_dumper
+EXE_TYPE := native # native | byte
+
+.PHONY: \
+ build \
+ install \
+ clean
+
+build: | bin
+ @ocamlbuild \
+ -cflags '-w A' \
+ -pkg unix \
+ -I src/exe \
+ -I src/lib \
+ $(EXE_NAME).$(EXE_TYPE)
+ @mv _build/src/exe/$(EXE_NAME).$(EXE_TYPE) bin/$(EXE_NAME)
+ @rm -f $(EXE_NAME).$(EXE_TYPE)
+
+install:
+ $(foreach filename,$(wildcard bin/*),cp -p "$(filename)" "$(PREFIX)/$(filename)"; )
+
+clean:
+ @rm -rf bin
+ @ocamlbuild -clean
+
+bin:
+ @mkdir -p bin