Create Makefile
Create Makefile to compile the tool easily.
@YJesus @patrick-g2 please, verify if there is something missing. There could be a sense to create a new tag release when this PR will be merged?
Hi D3vil0p3r,
Thanks for the PR.
I'm not sure that a tool with so little source files as unhide really needs a Makefile. As stated in the Readme file, building unhide for Linux only need 2 lines;
gcc -Wall -Wextra -O2 --static -pthread unhide-linux*.c unhide-output.c -o unhide-linux
gcc -Wall -Wextra -O2 --static unhide-tcp.c unhide-tcp-fast.c unhide-output.c -o unhide-tcp
And also two lines on other Unice (*BSD, Solaris OpenIndiana/Illumos, etc.):
gcc --static unhide-posix.c -o unhide-posix
gcc --static unhide-tcp.c unhide-tcp-fast.c unhide-output.c -o unhide-tcp
Note that I don't know the compiling options really used on this systems
In the two cases, it seems quite easy to me. :smiley:
unhide_rb is just a toy tools that should not be used in production any more.
Nonetheless quickly reviewing your Makefile, I have some remarks:
- At least three low level targets are needed: unhide-linux, unhide-tcp and unhide-posix.
- And then at least two high level targets: all-linux (unhide-linux and unhid-tcp) and all-BSD (unhide-posix and unhid-tcp)
- CLAGS needs to be corrected to meet those indicated in Readme file, depending on current system (Linux or Posix)
- The way you define CFLAGS generate a double "-Wall" option. That's not an error but it's useless.
- I recommend to install unhide on an USB key or somewhere in /root directory, not in standard binaries path.
- There's no default value for variable DESTDIR
- unhide should be owned by root:root, remember it can't be run by a standard user. Its permission should be 750 or 700
There might be more to say on further reading :wink:
Not to say at this point I will accept to add a makefile in a known future. :smile:
Regards.
Thank you @patrick-g2 . I understand your point, but for packaging on Linux distros, having a Makefile can make the process cleaner and easier to manage. Just think NixOS where its derivations can detect automatically a Makefile from a GitHub repository to compile it automatically.
PS: if Makefile needs to be changed, no problem.
Hi @D3vil0p3r,
Sorry for the delay, too much work IRL.
PS: if Makefile needs to be changed, no problem.
I thought it was clear. If a makefile has to find its way into the repository, it should at least:
- conform to POSIX make (unhide is used on non-Linux system)
- be corrected according to the remarks I made.
- have a long-term maintainer, as I have no time to do it.
In the meantime, I can add build scripts (makefile-linux.sh and makefile-posix.sh) if you find that useful.
so long!
In your opinion, my Makefile proposal in the PR is not suitable?
No offense intended, but that's kind of what I said. :)
If I ever agreed to add a makefile to the project, it wouldn't be the one you propose in its current state. The remarks I made in my first reply came from my review and testing of your file. They are not general comments that I could have made a priori.
Regards.
No worries. I will close this PR.