-
Notifications
You must be signed in to change notification settings - Fork 4
/
makefile
55 lines (44 loc) · 1.37 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
51
52
53
54
55
LIBS=-F/System/Library/PrivateFrameworks -framework MultitouchSupport \
-framework CoreFoundation \
-framework Carbon
BUILD_DIR=build
SOURCE_DIR=src
UTIL=trackpad_mapper_util
TARGET=trackpad_mapper
APP="Trackpad Mapper.app"
all:
if [[ ! -e ${BUILD_DIR} ]]; then mkdir -p ${BUILD_DIR}/bin; fi
make util
make app
make bundle
release:
if [[ ! -e ${BUILD_DIR} ]]; then mkdir -p ${BUILD_DIR}/bin; fi
make util_release
make app_release
make bundle
settings.h:
@if [[ ! -e settings.h ]]; then cp settings.def.h settings.h; fi
util:
make settings.h
gcc ${LIBS} ${SOURCE_DIR}/${UTIL}.c -o ${BUILD_DIR}/bin/${UTIL} -g
util_release:
make settings.h
gcc ${LIBS} ${SOURCE_DIR}/${UTIL}.c -o ${BUILD_DIR}/bin/${UTIL} -O3
app:
swiftc ${SOURCE_DIR}/*.swift -o ${BUILD_DIR}/bin/${TARGET} -g
app_release:
swiftc ${SOURCE_DIR}/*.swift -o ${BUILD_DIR}/bin/${TARGET} -O
bundle:
@if [[ ! -e ${BUILD_DIR}/${APP} ]]; then \
echo Creating app bundle; \
mkdir -p ${BUILD_DIR}/${APP}/Contents/MacOS; \
echo done; \
fi
@cp -R Resources ${BUILD_DIR}/${APP}/Contents/Resources
@cp Info.plist ${BUILD_DIR}/${APP}/Contents
@cp ${BUILD_DIR}/bin/${UTIL} ${BUILD_DIR}/${APP}/Contents/MacOS
@cp ${BUILD_DIR}/bin/${TARGET} ${BUILD_DIR}/${APP}/Contents/MacOS
install:
cp -R ${BUILD_DIR}/${APP} /Applications
install_util_update:
cp ${BUILD_DIR}/bin/${UTIL} /Applications/${APP}/Contents/MacOS