diff --git a/Makefile b/Makefile index ec6b46b..d061886 100644 --- a/Makefile +++ b/Makefile @@ -88,8 +88,12 @@ sslh: sslh-fork sslh-select sslh-ev $(OBJS) $(FORK_OBJS) $(SELECT_OBJS) $(EV_OBJS): argtable3.h collection.h common.h gap.h hash.h log.h probe.h processes.h sslh-conf.h tcp-listener.h tcp-probe.h tls.h udp-listener.h version.h -sslh-conf.c sslh-conf.h: sslhconf.cfg +c2s: conf2struct sslhconf.cfg + conf2struct echosrv.cfg + +sslh-conf.c sslh-conf.h: sslhconf.cfg + $(warning "sslhconf.cfg is more recent than sslh-conf.[ch]. Use `make c2s` to rebuild using `conf2struct`") sslh-fork: version.h Makefile $(FORK_OBJS) $(CC) $(CFLAGS) $(LDFLAGS) -o sslh-fork $(FORK_OBJS) $(LIBS) @@ -104,7 +108,7 @@ systemd-sslh-generator: systemd-sslh-generator.o $(CC) $(CFLAGS) $(LDFLAGS) -o systemd-sslh-generator systemd-sslh-generator.o -lconfig echosrv-conf.c echosrv-conf.h: echosrv.cfg - conf2struct echosrv.cfg + $(warning "echosrv.cfg is more recent than echosrv-conf.[ch]. Use `make c2s` to rebuild using `conf2struct`") echosrv: version.h echosrv-conf.c echosrv.o echosrv-conf.o argtable3.o $(CC) $(CFLAGS) $(LDFLAGS) -o echosrv echosrv.o echosrv-conf.o argtable3.o $(LIBS) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index c40c033..fb1b087 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -79,6 +79,20 @@ of the Makefile: * `USELIBBSD` compiles support for updating the process name (as shown by `ps`). +Generating the configuration parser +----------------------------------- + +The configuration file and command line parser is generated +by `conf2struct`, from `sslhconf.cfg`, which generates +`sslh-conf.c` and `sslh-conf.h`. The resulting files are +included in the source so `sslh` can be built without +`conf2struct` installed. + +Further, to prevent build issues, `sslh-conf.[ch]` has no +dependency to `sslhconf.cfg` in the Makefile. In the event +of adding configuration settings, they need to be +regenerated using `make c2s`. + Binaries --------