-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (36 loc) · 1.86 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
# autogenerated (and then hand modified)
# overrideable vars used in implicit make rules
CFLAGS ?= -Os -flto
CPPFLAGS += -Wall -Wextra -Wshadow
LDFLAGS += ${CFLAGS}
# list of targets to build, generated from .c files containing a main() function:
TARGETS=comorse context_switch_timing cotests
TARGETS_EXTRA=cotone
all : ${TARGETS}
# for each target, the list of objects to link, generated by recursively crawling include statements with a corresponding .c file:
comorse : comorse.o coroutine.o
context_switch_timing : context_switch_timing.o coroutine.o
cotests : cotests.o coroutine.o
cotone: LDLIBS += -framework SDL2
cotone: CFLAGS += -I/Library/Frameworks/SDL2.framework/Headers/
cotone: LDFLAGS += -F/Library/Frameworks/
cotone: cotone.o coroutine.o
# for each object, the list of headers it depends on, generated by recursively crawling include statements:
comorse.o : coroutine.h
context_switch_timing.o : coroutine.h
coroutine.o : coroutine.h
cotests.o : coroutine.h
cotone.o : coroutine.h
*.o : Makefile
clean :
$(RM) -rf *.o *.dSYM ${TARGETS} ${TARGETS_EXTRA}
.PHONY: clean all
check : cotests
@(./cotests 2>/dev/null | openssl md5 | grep bfdad74e6bc7bc9ab906212371eb9f80 1>/dev/null && echo pass) || echo fail
logstamp :
# if the head of the changelog is not a timestamp, prepend one, otherwise do nothing
@(head -n1 changelog | grep -e '2*T*Z\:' 1>/dev/null || (echo `date -u +%Y%m%dT%H%MZ:` > /tmp/a.txt && echo "" >> /tmp/a.txt && touch changelog && cat changelog >> /tmp/a.txt && cat /tmp/a.txt > changelog && rm /tmp/a.txt)) || true
PROJDIR=$(notdir $(shell pwd))
# when using this with git, the workflow for a commit should be: add entries to head of changelog; make logstamp; git commit; make dist
dist : clean logstamp
cd .. && COPYFILE_DISABLE=1 tar cjfh ${PROJDIR}_`date -u +%Y%m%dT%H%MZ`'.tar.bz2' --exclude='*xcuser*' --exclude='.DS_Store' ${PROJDIR}/