Skip to content

Commit

Permalink
remove dependency of sslh-conf.c to sslhconf.cfg (fix #283)
Browse files Browse the repository at this point in the history
  • Loading branch information
yrutschle committed Aug 13, 2023
1 parent 4728730 commit 4cc0867
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
14 changes: 14 additions & 0 deletions doc/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------

Expand Down

0 comments on commit 4cc0867

Please sign in to comment.