mirror of
https://github.com/samsonjs/csc360-a1-shell.git
synced 2026-03-25 08:45:52 +00:00
Improve portability of Makefile
This commit is contained in:
parent
7f95910a9c
commit
421f3f981e
3 changed files with 24 additions and 5 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*.o
|
||||
a1
|
||||
4
Makefile
4
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
CFLAGS = -Wall -g
|
||||
CPPFLAGS = -I/usr/local/opt/readline/include
|
||||
LDFLAGS = -L/usr/local/opt/readline/lib
|
||||
CPPFLAGS = -I$(shell ./dependency-dir)/readline/include
|
||||
LDFLAGS = -L$(shell ./dependency-dir)/readline/lib
|
||||
|
||||
OBJS = utils.o builtins.o exec.o jobs.o main.o
|
||||
|
||||
|
|
|
|||
17
dependency-dir
Executable file
17
dependency-dir
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [[ $(uname -s) = Darwin ]]; then
|
||||
if command -v brew >/dev/null 2>/dev/null; then
|
||||
echo $(brew --prefix)/opt
|
||||
elif [[ -x /opt/homebrew/bin/brew ]]; then
|
||||
echo $(/opt/homebrew/bin/brew -- prefix)/opt
|
||||
elif [[ -x $HOME/homebrew/bin/brew ]]; then
|
||||
echo $($HOME/homebrew/bin/brew --prefix)/opt
|
||||
elif [[ -x /usr/local/bin/brew ]]; then
|
||||
echo $(/usr/local/bin/brew --prefix)/opt
|
||||
else
|
||||
echo /usr/local
|
||||
fi
|
||||
else
|
||||
echo /usr
|
||||
fi
|
||||
Loading…
Reference in a new issue