From 83bd22bef9aaf6f85e48556709f0d486574e50e0 Mon Sep 17 00:00:00 2001 From: Igor Socec Date: Wed, 25 Jan 2017 01:33:37 +0100 Subject: [PATCH] Change names of config file and control script Also make top Makefile more tidy. --- Makefile | 22 ++++++++++++---------- README.md | 12 ++++++------ moxerver/Makefile | 4 ++-- {moxanix => tools}/Makefile | 4 ++-- moxanix/moxanix.cfg => tools/moxerver.cfg | 0 moxanix/moxanix.sh => tools/moxerverctl | 0 6 files changed, 22 insertions(+), 20 deletions(-) rename {moxanix => tools}/Makefile (93%) rename moxanix/moxanix.cfg => tools/moxerver.cfg (100%) rename moxanix/moxanix.sh => tools/moxerverctl (100%) diff --git a/Makefile b/Makefile index d349e17..7cb6718 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # components -MOXERVER = moxerver -MOXANIX = moxanix +SERVER = moxerver +TOOLS = tools # ============================================================================== @@ -15,6 +15,8 @@ BIN_PREFIX = /usr # directories used for local component builds BUILDDIR = build.dir INSTALLDIR = install.dir +# directory configuration for local component builds +DIR_CONFIG = BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) BIN_PREFIX=$(BIN_PREFIX) # ============================================================================== @@ -26,21 +28,21 @@ all: default install # default builds components default: - cd $(MOXERVER) && make BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) - cd $(MOXANIX) && make BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) + cd $(SERVER) && make $(DIR_CONFIG) + cd $(TOOLS) && make $(DIR_CONFIG) # install handles component installation install: default mkdir -p $(INSTALL_ROOT) - cd $(MOXERVER) && make install BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) BIN_PREFIX=$(BIN_PREFIX) - cp -r $(MOXERVER)/$(INSTALLDIR)/* $(INSTALL_ROOT)/ + cd $(SERVER) && make install $(DIR_CONFIG) + cp -r $(SERVER)/$(INSTALLDIR)/* $(INSTALL_ROOT)/ - cd $(MOXANIX) && make install BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) BIN_PREFIX=$(BIN_PREFIX) - cp -r $(MOXANIX)/$(INSTALLDIR)/* $(INSTALL_ROOT)/ + cd $(TOOLS) && make install $(DIR_CONFIG) + cp -r $(TOOLS)/$(INSTALLDIR)/* $(INSTALL_ROOT)/ # clean removes build and install results clean: - cd $(MOXERVER) && make clean BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) - cd $(MOXANIX) && make clean BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) + cd $(SERVER) && make clean $(DIR_CONFIG) + cd $(TOOLS) && make clean $(DIR_CONFIG) -rm -rf $(INSTALL_ROOT) diff --git a/README.md b/README.md index 7128e71..cd1f95e 100644 --- a/README.md +++ b/README.md @@ -19,19 +19,19 @@ moxerver - allows bidirectional communication - it is expected to run a separate instance for every serial device and TCP port pair -moxanix.sh ----------- +moxerverctl +----------- - starts, stops or displays status for different moxervers - commands can handle one specific or all moxervers at once -moxanix.cfg ------------ +moxerver.cfg +------------ - defines connections between serial devices and TCP ports - each line corresponds to one micro server handling the defined connection Build and install ================= -Run "make" to build the project. +Run `make` to build the project. The build artifacts can be found in the directory "install.dir" and should be copied from there. -If you want to install directly to some directory run "make INSTALL_ROOT=/some/dir". +If you want to install directly to some directory run `make INSTALL_ROOT=/some/dir`. diff --git a/moxerver/Makefile b/moxerver/Makefile index 2c9a19f..458cb5e 100644 --- a/moxerver/Makefile +++ b/moxerver/Makefile @@ -40,7 +40,7 @@ $(BUILDDIR)/%.o: %.c mkdir -p $(BUILDDIR) $(CC) $(CFLAGS) -c $< -o $@ -# target is built from all object files +# target binary is built from all object files $(BUILDDIR)/$(TARGET_BINARY): $(OBJECTS) $(CC) $(OBJECTS) $(CFLAGS) -o $@ @@ -55,7 +55,7 @@ all: default install # default builds target default: $(BUILDDIR)/$(TARGET_BINARY) -# install target +# install target binary install: default mkdir -p $(INSTALLDIR)/$(BIN_PREFIX)/bin cp $(BUILDDIR)/$(TARGET_BINARY) $(INSTALLDIR)/$(BIN_PREFIX)/bin diff --git a/moxanix/Makefile b/tools/Makefile similarity index 93% rename from moxanix/Makefile rename to tools/Makefile index 52cd9b6..e1ee535 100644 --- a/moxanix/Makefile +++ b/tools/Makefile @@ -1,6 +1,6 @@ # target names -TARGET_CONTROL = moxanix.sh -TARGET_CONFIG = moxanix.cfg +TARGET_CONTROL = moxerverctl +TARGET_CONFIG = moxerver.cfg # ============================================================================== diff --git a/moxanix/moxanix.cfg b/tools/moxerver.cfg similarity index 100% rename from moxanix/moxanix.cfg rename to tools/moxerver.cfg diff --git a/moxanix/moxanix.sh b/tools/moxerverctl similarity index 100% rename from moxanix/moxanix.sh rename to tools/moxerverctl