-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·26 lines (22 loc) · 1.04 KB
/
configure
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
#! /bin/bash
# I usually have this kind of script in my project folder so that I don't have to manually write the configure options every time I add new dependencies to the project
# This is a basic one for a C project
# You can find a better one for a C++ project here:
# https://github.com/posva/InputManager
# This script works on Windows. Installing cygwin is the easiest way to get this working
CONF=~/configure.py/configure.py
if [[ ! -x ${CONF} ]]; then
git clone https://github.com/posva/configure.py.git ~/configure.py
fi
#Common options between different OS
OPT="-Wall -Wextra -O2"
EXT=c
MAK="Makefile"
EXEC=../sh2d/exc/catimg.c
if [ `uname` = "Darwin" ]; then
${CONF} -D -s src -o obj -b bin -c "xcrun clang" -O "$OPT" -Isrc -L/usr/local/lib -e $EXT -E ${EXEC} -M $MAK -l "-lm" $@
elif [ `uname` = "Linux" ]; then
${CONF} -D -s src -o obj -b bin -c "clang" -O "$OPT" -Isrc -L/usr/local/lib -e $EXT -E ${EXEC} -M $MAK -l "-lm" $@
else
${CONF} -D -s src -o obj -b bin -c "mingw32-gcc" -O "$OPT" -Isrc -e $EXT -E ${EXEC} -M $MAK -l "-lm" $@
fi