What can I use to program Lua script on Mac OS X? I'm looking for something that I can use to compile/interpret Lua script on OS X.
My preferred way:
brew install lua
Thanks, Max!
And if you need to know how to install Homebrew, see Link and:
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
The Lua source easily compiles with no changes on the mac. It will build lua (the interpreter which can act on a source script, a pre-compiled script or interactively) and luac which can be used to pre-compile source scripts.
From the lua.org website: http://luabinaries.luaforge.net/download.html. The ones you want are the darwin binaries (they say Mac OS X in the description).
My favorite way (from the shell):
sudo port install lua
I LOVE macports!
Here is my terminal session from compiling and installing Lua from source, basically following these directions. I already had Apple's Developer Tools installed, and /usr/local/bin was already in my PATH, so I was able to skip some of the more time-consuming and/or tedious steps in the directions.
$ cd ~/Downloads
$ tar -xf lua-5.1.4.tar
$ cd lua-5.1.4
$ make macosx
cd src && make macosx
make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lapi.o lapi.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lcode.o lcode.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ldebug.o ldebug.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ldo.o ldo.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ldump.o ldump.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lfunc.o lfunc.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lgc.o lgc.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o llex.o llex.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lmem.o lmem.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lobject.o lobject.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lopcodes.o lopcodes.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lparser.o lparser.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lstate.o lstate.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lstring.o lstring.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ltable.o ltable.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ltm.o ltm.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lundump.o lundump.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lvm.o lvm.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lzio.o lzio.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lauxlib.o lauxlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lbaselib.o lbaselib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ldblib.o ldblib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o liolib.o liolib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lmathlib.o lmathlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o loslib.o loslib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o ltablib.o ltablib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lstrlib.o lstrlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o loadlib.o loadlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o
ranlib liblua.a
gcc -O2 -Wall -DLUA_USE_LINUX -c -o lua.o lua.c
gcc -o lua lua.o liblua.a -lm -lreadline
gcc -O2 -Wall -DLUA_USE_LINUX -c -o luac.o luac.c
gcc -O2 -Wall -DLUA_USE_LINUX -c -o print.o print.c
gcc -o luac luac.o print.o liblua.a -lm -lreadline
$ make test
src/lua test/hello.lua
Hello world, from Lua 5.1!
$ sudo make install INSTALL_TOP=/usr/local
Password:
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib /usr/local/man/man1 /usr/local/share/lua/5.1 /usr/local/lib/lua/5.1
cd src && install -p -m 0755 lua luac /usr/local/bin
cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp /usr/local/include
cd src && install -p -m 0644 liblua.a /usr/local/lib
cd doc && install -p -m 0644 lua.1 luac.1 /usr/local/man/man1
$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print "Hi"
Hi
> = 2 + 3
5
> ^c
$ cd test
$ lua factorial.lua
0! = 1
1! = 1
2! = 2
3! = 6
4! = 24
5! = 120
6! = 720
7! = 5040
8! = 40320
9! = 362880
10! = 3628800
11! = 39916800
12! = 479001600
13! = 6227020800
14! = 87178291200
15! = 1307674368000
16! = 20922789888000
If you don't want to compile your own Lua binaries, you can try ZeroBrane Studio Lua IDE, which comes packaged as a .dmg file for OSX. It's an IDE that allows you to edit and debug your Lua scripts. If you are just starting with Lua, it also includes 50+ examples and demo scripts, as well as integrated instructions on running them, so you won't be facing an empty screen not knowing where to start.
I just recently found Rudix—a maintained collection of precompiled Unix software for Mac.
While I'm sure you've already figured out a way of installing Lua, I came across your question by Googling the same thing. For anyone that's interested, here's the link to a recent Lua 5.1.4 dmg.
Related
Please I need help, I need to install this library quickly for a project I am working on (https://github.com/LuaDist/mapm) and I don't understand makefile. Per the instructions I run the command "make" and get the following output:
gcc -c -Wall -O2 mapmhsin.c
gcc -c -Wall -O2 mapm_pow.c
gcc -c -Wall -O2 mapm_log.c
gcc -c -Wall -O2 mapm_lg2.c
gcc -c -Wall -O2 mapm_lg4.c
gcc -c -Wall -O2 mapm_exp.c
gcc -c -Wall -O2 mapm_lg3.c
gcc -c -Wall -O2 mapmasin.c
gcc -c -Wall -O2 mapmasn0.c
gcc -c -Wall -O2 mapm_sin.c
gcc -c -Wall -O2 mapm5sin.c
gcc -c -Wall -O2 mapmrsin.c
gcc -c -Wall -O2 mapm_cpi.c
gcc -c -Wall -O2 mapmsqrt.c
gcc -c -Wall -O2 mapmcbrt.c
gcc -c -Wall -O2 mapmgues.c
gcc -c -Wall -O2 mapmfact.c
gcc -c -Wall -O2 mapm_gcd.c
gcc -c -Wall -O2 mapmipwr.c
gcc -c -Wall -O2 mapmpwr2.c
gcc -c -Wall -O2 mapm_rnd.c
gcc -c -Wall -O2 mapm_flr.c
gcc -c -Wall -O2 mapm_fpf.c
gcc -c -Wall -O2 mapm_rcp.c
gcc -c -Wall -O2 mapmstck.c
gcc -c -Wall -O2 mapm_div.c
gcc -c -Wall -O2 mapm_mul.c
gcc -c -Wall -O3 mapmfmul.c
gcc -c -Wall -O2 mapm_fft.c
gcc -c -Wall -O2 mapm_add.c
gcc -c -Wall -O2 mapmistr.c
gcc -c -Wall -O2 mapm_set.c
gcc -c -Wall -O2 mapm_fam.c
gcc -c -Wall -O3 mapmutil.c
gcc -c -Wall -O2 mapmutl2.c
gcc -c -Wall -O2 mapmutl1.c
gcc -c -Wall -O2 mapmcnst.c
rm -f libmapm.a
ar rc libmapm.a mapmhasn.o mapmhsin.o mapm_pow.o mapm_log.o mapm_lg2.o mapm_lg4.o mapm_exp.o mapm_lg3.o mapmasin.o mapmasn0.o mapm_sin.o mapm5sin.o mapmrsin.o mapm_cpi.o mapmsqrt.o mapmcbrt.o mapmgues.o mapmfact.o mapm_gcd.o mapmipwr.o mapmpwr2.o mapm_rnd.o mapm_flr.o mapm_fpf.o mapm_rcp.o mapmstck.o mapm_div.o mapm_mul.o mapmfmul.o mapm_fft.o mapm_add.o mapmistr.o mapm_set.o mapm_fam.o mapmutil.o mapmutl2.o mapmutl1.o mapmcnst.o
gcc -c -Wall -O2 calc.c
gcc -s -static -o calc calc.o libmapm.a -lm
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [Makefile:63: calc] Error 1
It looks like everything goes fine until the end:
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Is there any way I fix this, and what does the command -lm and -lc do?
I am trying to convert a (sloppy) Makefile into a CMakeLists.txt to better work with my IDE (CLion).
My Makefile is as follows:
all:
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/boot0.o boot/boot0/boot0.S
ld -nostdlib -m elf_i386 -N -e start -Ttext 0x7c00 -o bin/boot0.elf bin/boot0.o
objcopy -S -O binary bin/boot0.elf bin/boot0
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/boot1.o boot/boot1/boot1.S
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/boot1main.o boot/boot1/boot1main.c
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/boot1lib.o boot/boot1/boot1lib.c
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -Os -g -m32 -I. -c -o bin/exec_kernel.o boot/boot1/exec_kernel.S
ld -nostdlib -m elf_i386 -N -e start -Ttext 0xd7000 -o bin/boot1.elf bin/boot1.o bin/boot1main.o bin/boot1lib.o bin/exec_kernel.o
objcopy -S -O binary bin/boot1.elf bin/boot1
gcc -MD -fno-builtin -nostdinc -fno-stack-protector -D_KERN_ -Ikern -Ikern/kern -I. -m32 -O0 -c -o bin/entry.o kern/init/entry.S
ld -o kernel -nostdlib -e start -m elf_i386 -Ttext=0x00100000 bin/entry.o -b binary
dd if=/dev/zero of=project0.img bs=512 count=256
parted -s project0.img "mktable msdos mkpart primary 63s -1s set 1 boot on"
dd if=bin/boot0 of=project0.img bs=446 count=1 conv=notrunc
dd if=bin/boo1 of=project0.img bs=512 count=62 seek=1 conv=notrunc
dd if=kern/init/kernel of=project0.img bs=512 seek=63 conv=notrunc
Mostly I am using make just to run the commands.
I am running into trouble with the fact that I have three different sets of linker flags (one each for boot0, boot1, and kern.)
Should I create separate CMakeLists.txt in each subdirectory (boot0, boot1, and kern) and then have a main one that runs each in turn and then handles the dd and parted usage, is there a better way to do this, or is CMake not an appropriate tool here?
Please have short-cuts for the compiler commands first. Then write the rule to create the first target on which the second target is dependent. Then since the first target is created; now use it to create the second target.
I'm working in Windows 7, 64 bit, running in a Virtual Box machine on a (recent-ish) Mac with Intel processor.
I have MinGW installed:
gcc -dumpmachine
>>> x86_64-w64-mingw32
I am trying to compile a Windows exe for this code (Landsat-8 routines for solar and satellite angle calculations):
gcc -I ias_lib -o l8_angle.exe -c l8_angle.c
which gives me no errors or warnings when run, and creates l8_angle.exe as expected. When opened, the exe gives:
The version of this file is not compatible with the version of Windows
you're running. Check your computer's system information to see
whether you need an x86 (32-bit) for x64 (64-bit) version of the
program, and then contact the software publisher.
Is it possible to compile this program on my setup?
If you're wondering I can run make on the Mac OS side to get a Linux executable, but I need a Windows executable for my production machine.
I was able to compile successully by echoing the gcc statements in both makefiles:
#echo $(value INCS)
which for some reasom prints the completely assembled gcc command. I then confirmed what the selected flags did and saw that they were all equally appropriate for a Windows build.
The build commands were then:
cd ias_lib
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_calculate_angles_rpc.c -o ias_angle_gen_calculate_angles_rpc.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_read_ang.c -o ias_angle_gen_read_ang.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_utilities.c -o ias_angle_gen_utilities.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_initialize.c -o ias_angle_gen_initialize.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_write_image.c -o ias_angle_gen_write_image.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_angle_gen_find_scas.c -o ias_angle_gen_find_scas.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_geo_convert_dms2deg.c -o ias_geo_convert_dms2deg.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_compute_unit_vector.c -o ias_math_compute_unit_vector.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_compute_vector_length.c -o ias_math_compute_vector_length.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_math_find_line_segment_intersection.c -o ias_math_find_line_segment_intersection.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_logging.c -o ias_logging.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_create_output_image_trim_lut.c -o ias_misc_create_output_image_trim_lut.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_convert_to_uppercase.c -o ias_misc_convert_to_uppercase.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_misc_write_envi_header.c -o ias_misc_write_envi_header.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_free_tree.c -o ias_odl_free_tree.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_get_field.c -o ias_odl_get_field.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_odl_read_tree.c -o ias_odl_read_tree.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_provide_help.c -o ias_parm_provide_help.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_read.c -o ias_parm_read.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_map_odl_type.c -o ias_parm_map_odl_type.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_parm_check_ranges.c -o ias_parm_check_ranges.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c ias_satellite_attributes.c -o ias_satellite_attributes.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c landsat8.c -o landsat8.o
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -c lablib3.c -o lablib3.o
ar -r libl8ang.a ias_angle_gen_calculate_angles_rpc.o ias_angle_gen_read_ang.o ias_angle_gen_utilities.o ias_angle_gen_initialize.o ias_angle_gen_write_image.o ias_angle_gen_find_scas.o ias_geo_convert_dms2deg.o ias_math_compute_unit_vector.o ias_math_compute_vector_length.o ias_math_find_line_segment_intersection.o ias_logging.o ias_misc_create_output_image_trim_lut.o ias_misc_convert_to_uppercase.o ias_misc_write_envi_header.o ias_odl_free_tree.o ias_odl_get_field.o ias_odl_read_tree.o ias_parm_provide_help.o ias_parm_read.o ias_parm_map_odl_type.o ias_parm_check_ranges.o ias_satellite_attributes.o landsat8.o lablib3.o
cd ..
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -I./ias_lib/ -I./ -c -o l8_angles.o l8_angles.c
gcc -g -Wall -O2 -march=nocona -mfpmath=sse -msse2 -I./ias_lib/ -I./ -c -o angles_api.o angles_api.c
gcc -g -Wall -O2 -I./ias_lib/ -I./ -o l8_angles.exe ias_lib/libl8ang.a l8_angles.o angles_api.o -L./ias_lib/ -ll8ang -lm
where the only change was in the final line, l8_angles.exe rather than l8_angles. If anyone has a more straightforward way, I would love to see it.
i tried to setup a latex linter in atom. The one I found was linter-chktex. For it to be working I have to install ChkTeX. So I have downloaded it here. But every time I'm trying to make i get the following error:
FindErrs.c:39:10: fatal error: 'pcreposix.h' file not found
Can someone explain to me how to get it working?
EDIT: I fixed this error by giving the full path of pcreposix.h after locating it. make does work now and here is the log:
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ Utility.c > .Utility.d.tmp
sed 's,\(Utility\)\.o *:,\1.o .Utility.d : Makefile,g' .Utility.d.tmp > .Utility.d
rm -f .Utility.d.tmp 2>/dev/null
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ Resource.c > .Resource.d.tmp
sed 's,\(Resource\)\.o *:,\1.o .Resource.d : Makefile,g' .Resource.d.tmp > .Resource.d
rm -f .Resource.d.tmp 2>/dev/null
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ OpSys.c > .OpSys.d.tmp
sed 's,\(OpSys\)\.o *:,\1.o .OpSys.d : Makefile,g' .OpSys.d.tmp > .OpSys.d
rm -f .OpSys.d.tmp 2>/dev/null
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ FindErrs.c > .FindErrs.d.tmp
sed 's,\(FindErrs\)\.o *:,\1.o .FindErrs.d : Makefile,g' .FindErrs.d.tmp > .FindErrs.d
rm -f .FindErrs.d.tmp 2>/dev/null
gcc -M -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ ChkTeX.c > .ChkTeX.d.tmp
sed 's,\(ChkTeX\)\.o *:,\1.o .ChkTeX.d : Makefile,g' .ChkTeX.d.tmp > .ChkTeX.d
rm -f .ChkTeX.d.tmp 2>/dev/null
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c ChkTeX.c -o ChkTeX.o
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c FindErrs.c -o FindErrs.o
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c OpSys.c -o OpSys.o
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c Resource.c -o Resource.o
gcc -I. -I. -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -D__unix__ -g -O2 -Wstrict-prototypes -Wall -I/usr/local/Cellar/pcre/8.37/include -c Utility.c -o Utility.o
gcc -L/usr/local/Cellar/pcre/8.37/lib -lpcreposix -lpcre -o chktex ChkTeX.o FindErrs.o OpSys.o Resource.o Utility.o -ltermcap
But as soon as I try to sudo make install this error appears:
no ChkTeX.tex
make: no: No such file or directory
make: *** [ChkTeX.dvi] Error 1
But the ChkTeX.tex is in the directory.
I just had the same problem.
Turns out make does not find the file no in your directory. no is the content of the LATEX variable in the Makefile, if ./configure did not find a LaTeX distribution.
If you set the LATEX variable to the path of your latex executable, you can run sudo make install without a problem.
In my case (El Capitan) I had to put
LATEX=/usr/local/texlive/2015/bin/x86_64-darwin/latex
on line 48 of the makefile, and thereby replace
LATEX=no
to make it work.
I have some problems with creating makefile. I have tried to compile some files from terminal and found right options for gcc to do this.
But I have some troubles with creating one makefile to do all this tasks.
Here are my commands that work.
gcc -c pstree.c -DHAVE_CONFIG_H -I.
gcc -o hello pstree.o -L/usr/lib/ -ltinfo
gcc -c fuser.c -DHAVE_CONFIG_H -I.
gcc -c -o libsignals.a signals.c
gcc -o hello fuser.o -L/usr/lib/ -L. -lsignals
gcc -c -o libsignals.a signals.c
gcc -o hello killall.o -L/usr/lib/ -L. -lsignals
gcc -c killall.c -DHAVE_CONFIG_H -I.
How can I make a Makefile for executing these commands?
killall: hello\ fuser.o
gcc -c -o libsignals.a signals.c
gcc -o hello killall.o -L/usr/lib/ -L. -lsignals
gcc -c killall.c -DHAVE_CONFIG_H -I.
fuser: hello\ pstree.o
gcc -c fuser.c -DHAVE_CONFIG_H -I.
gcc -c -o libsignals.a signals.c
gcc -o hello\ fuser.o -L/usr/lib/ -L. -lsignals
pstree:
gcc -c pstree.c -DHAVE_CONFIG_H -I.
gcc -o hello\ pstree.o -L/usr/lib/ -ltinfo
clean:
rm -rf *.o
I wrote very very dirty you can define cc variable such as:
CC = gcc
CFLAGS = -g -Wall -I.
LIBS = -L/usr/lib/ -lsignals
and so on.....
Mine is very dirty ....
NOTE: Before each line of intending you have to use TAB, not space.
usage :
make clean
make killall