Althttpd

Check-in [0736e5f6e5]
Login

Check-in [0736e5f6e5]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Reformulated the version-related CPPFLAGS in such a way which should (or might) be compatible with more Make variants, namely BSD Make.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0736e5f6e59cb3972c81a05cd4f2bf08df2691d06b4fb9ab4e9f6bacd21840f7
User & Date: stephan 2022-01-19 04:42:39
References
2022-01-19
04:47 Reply: error:02FFF020:system library:func(4095):Broken pipe when using port 443 ... (artifact: 23fa09b3e6 user: stephan)
Context
2022-01-19
05:59
Added contrib/docker as a convenient method of building a fully/properly-static althttpd. ... (check-in: 6f6cf2d5a5 user: stephan tags: trunk)
04:42
Reformulated the version-related CPPFLAGS in such a way which should (or might) be compatible with more Make variants, namely BSD Make. ... (check-in: 0736e5f6e5 user: stephan tags: trunk)
2022-01-18
16:06
Add an earlier check for running as root without the -user flag and fail before establishing the network listener. Part of the /forumpost/1e536f9fb0bf5310 discussion. ... (check-in: 57fce9cebf user: stephan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16










17

18
19
20

21
22
23

24
25
26

27
28
29
30

default: althttpd althttpsd 

VERSION_NUMBER ?= 2.0
VERSION_HASH ?= $(shell cut -c1-12 manifest.uuid)
VERSION_TIME ?= $(shell sed -n 2p manifest | cut -d' ' -f2)
ALTHTTPD_VERSION ?= "$(VERSION_NUMBER) [$(VERSION_HASH)] $(VERSION_TIME)"
CPPFLAGS += -DALTHTTPD_VERSION='$(ALTHTTPD_VERSION)'

manifest:
	@if which fossil > /dev/null; then \
		fossil update --nosync current; \
	else \
	  echo "fossil binary not found. Version hash/time might be incorrect."
	fi
manifest.uuid: manifest











althttpd:	althttpd.c manifest Makefile

	cc $(CPPFLAGS) -Os -Wall -Wextra -o althttpd althttpd.c

althttpsd:	althttpd.c manifest Makefile

	cc $(CPPFLAGS) -Os -Wall -Wextra -fPIC -o althttpsd -DENABLE_TLS althttpd.c -lssl -lcrypto

static-althttpd:	althttpd.c manifest Makefile

	cc $(CPPFLAGS) -Os -Wall -Wextra -static -o althttpd althttpd.c

static-althttpsd:	althttpd.c manifest Makefile

	cc $(CPPFLAGS) -Os -Wall -Wextra -static -fPIC -o althttpsd -DENABLE_TLS althttpd.c -lssl -lcrypto -lpthread -ldl

clean:	
	rm -f althttpd althttpsd


<
|
<
<
<
<









>
>
>
>
>
>
>
>
>
>
|
>
|

|
>
|

|
>
|

|
>
|


|
>
1

2




3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
default: althttpd althttpsd 

VERSION_NUMBER = 2.0





manifest:
	@if which fossil > /dev/null; then \
		fossil update --nosync current; \
	else \
	  echo "fossil binary not found. Version hash/time might be incorrect."
	fi
manifest.uuid: manifest

# We do the version-setting CPPFLAGS this way, instead of via
# $(shell...), for the sake of portability with BSD Make. Some hoops
# have to be jumped through to get the escaping "just right," though.
version: Makefile manifest.uuid
	@hash=`cut -c1-12 manifest.uuid`; \
	time=`sed -n 2p manifest | cut -d' ' -f2`; \
	{ echo -n "ALTHTTPD_VERSION=\""; \
		echo '$(VERSION_NUMBER)' "[$$hash] [$$time]\""; \
	} > $@

althttpd:	althttpd.c version
	@flags="`cat version`"; set -x; \
	cc "-D$$flags" -Os -Wall -Wextra -o althttpd althttpd.c

althttpsd:	althttpd.c version
	@flags="`cat version`"; set -x; \
	cc "-D$$flags" -Os -Wall -Wextra -fPIC -o althttpsd -DENABLE_TLS althttpd.c -lssl -lcrypto

static-althttpd:	althttpd.c version
	@flags="`cat version`"; set -x; \
	cc "-D$$flags" -Os -Wall -Wextra -static -o althttpd althttpd.c

static-althttpsd:	althttpd.c version
	@flags="`cat version`"; set -x; \
	cc "-D$$flags" -Os -Wall -Wextra -static -fPIC -o althttpsd -DENABLE_TLS althttpd.c -lssl -lcrypto -lpthread -ldl

clean:	
	rm -f althttpd althttpsd version