forked from nayarsystems/posix_tz_db
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
38 lines (27 loc) · 982 Bytes
/
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
31
32
33
34
35
36
37
38
CC=gcc
CFLAGS=-I.
DEPS=zones.h
TAG=posix-tz-db
.PHONY: all clean example docker
all: zones.o zones.c zones.json zones.csv
# `zones.o` intentionally does not depend on making `zones.c`, since `zones.c` requires the
# consistent build environment provided by Docker or the latest Arch Linux, and would only
# actually need an update a few times a year or so. `zones.c` is checked in to source
# control though, so build it when it gets updated, commit it, and you're good.
zones.o: zones.h
$(CC) -c -o zones.o $(CFLAGS) zones.c
zones.c: docker
docker run -i $(TAG) ./gen-tz.py -e > $@
zones.json: docker
docker run -i $(TAG) ./gen-tz.py -j > $@
zones.csv: docker
docker run -i $(TAG) ./gen-tz.py -c > $@
docker: Dockerfile scripts
docker build . -t $(TAG)
run-example: example/example
example/example
example: example/example
example/example: zones.o example/example.c
gcc -o example/example zones.o $(CFLAGS) example/example.c
clean:
rm -f zones.o example/example