Change names of config file and control script

Also make top Makefile more tidy.
This commit is contained in:
Igor Socec 2017-01-25 01:33:37 +01:00
parent a1162d1674
commit 83bd22bef9
6 changed files with 22 additions and 20 deletions

View file

@ -1,6 +1,6 @@
# components # components
MOXERVER = moxerver SERVER = moxerver
MOXANIX = moxanix TOOLS = tools
# ============================================================================== # ==============================================================================
@ -15,6 +15,8 @@ BIN_PREFIX = /usr
# directories used for local component builds # directories used for local component builds
BUILDDIR = build.dir BUILDDIR = build.dir
INSTALLDIR = install.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 builds components
default: default:
cd $(MOXERVER) && make BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) cd $(SERVER) && make $(DIR_CONFIG)
cd $(MOXANIX) && make BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) cd $(TOOLS) && make $(DIR_CONFIG)
# install handles component installation # install handles component installation
install: default install: default
mkdir -p $(INSTALL_ROOT) mkdir -p $(INSTALL_ROOT)
cd $(MOXERVER) && make install BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) BIN_PREFIX=$(BIN_PREFIX) cd $(SERVER) && make install $(DIR_CONFIG)
cp -r $(MOXERVER)/$(INSTALLDIR)/* $(INSTALL_ROOT)/ cp -r $(SERVER)/$(INSTALLDIR)/* $(INSTALL_ROOT)/
cd $(MOXANIX) && make install BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) BIN_PREFIX=$(BIN_PREFIX) cd $(TOOLS) && make install $(DIR_CONFIG)
cp -r $(MOXANIX)/$(INSTALLDIR)/* $(INSTALL_ROOT)/ cp -r $(TOOLS)/$(INSTALLDIR)/* $(INSTALL_ROOT)/
# clean removes build and install results # clean removes build and install results
clean: clean:
cd $(MOXERVER) && make clean BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) cd $(SERVER) && make clean $(DIR_CONFIG)
cd $(MOXANIX) && make clean BUILDDIR=$(BUILDDIR) INSTALLDIR=$(INSTALLDIR) cd $(TOOLS) && make clean $(DIR_CONFIG)
-rm -rf $(INSTALL_ROOT) -rm -rf $(INSTALL_ROOT)

View file

@ -19,19 +19,19 @@ moxerver
- allows bidirectional communication - allows bidirectional communication
- it is expected to run a separate instance for every serial device and TCP port pair - 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 - starts, stops or displays status for different moxervers
- commands can handle one specific or all moxervers at once - commands can handle one specific or all moxervers at once
moxanix.cfg moxerver.cfg
----------- ------------
- defines connections between serial devices and TCP ports - defines connections between serial devices and TCP ports
- each line corresponds to one micro server handling the defined connection - each line corresponds to one micro server handling the defined connection
Build and install 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. 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`.

View file

@ -40,7 +40,7 @@ $(BUILDDIR)/%.o: %.c
mkdir -p $(BUILDDIR) mkdir -p $(BUILDDIR)
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
# target is built from all object files # target binary is built from all object files
$(BUILDDIR)/$(TARGET_BINARY): $(OBJECTS) $(BUILDDIR)/$(TARGET_BINARY): $(OBJECTS)
$(CC) $(OBJECTS) $(CFLAGS) -o $@ $(CC) $(OBJECTS) $(CFLAGS) -o $@
@ -55,7 +55,7 @@ all: default install
# default builds target # default builds target
default: $(BUILDDIR)/$(TARGET_BINARY) default: $(BUILDDIR)/$(TARGET_BINARY)
# install target # install target binary
install: default install: default
mkdir -p $(INSTALLDIR)/$(BIN_PREFIX)/bin mkdir -p $(INSTALLDIR)/$(BIN_PREFIX)/bin
cp $(BUILDDIR)/$(TARGET_BINARY) $(INSTALLDIR)/$(BIN_PREFIX)/bin cp $(BUILDDIR)/$(TARGET_BINARY) $(INSTALLDIR)/$(BIN_PREFIX)/bin

View file

@ -1,6 +1,6 @@
# target names # target names
TARGET_CONTROL = moxanix.sh TARGET_CONTROL = moxerverctl
TARGET_CONFIG = moxanix.cfg TARGET_CONFIG = moxerver.cfg
# ============================================================================== # ==============================================================================