0xtools icon indicating copy to clipboard operation
0xtools copied to clipboard

Modify Makefile to better accommodate cross compilation

Open bertofurth opened this issue 2 years ago • 2 comments

Thanks for creating this valuable tool.

Can I suggest some minor changes to the Makefile that will make it much easier to cross compile your useful tool?

These will more easily allow people to specify an alternate compiler (CC) and installation destination (PREFIX)

--- Makefile.orig       2022-09-23 12:06:14.876630117 +1000
+++ Makefile    2022-09-23 12:09:03.834063588 +1000
@@ -1,8 +1,8 @@
-CC=gcc
+CC ?= gcc
 PREFIX ?= /usr

 # build
-CFLAGS=-I include -Wall
+CFLAGS ?= -Wall

 # debuginfo included
 CFLAGS_DEBUG=-I include -ggdb -Wall
@@ -11,7 +11,7 @@
 CFLAGS_DEBUG0=-I include -ggdb -O0

 all:
-       $(CC) $(CFLAGS) -o bin/xcapture src/xcapture.c
+       $(CC) $(CFLAGS) -I include -o bin/xcapture src/xcapture.c

 debug:
        $(CC) $(CFLAGS_DEBUG) -o bin/xcapture src/xcapture.c
@@ -20,6 +20,7 @@
        $(CC) $(CFLAGS_DEBUG0) -o bin/xcapture src/xcapture.c

 install:
+       install -m 0755 -d ${PREFIX}/bin
        install -m 0755 bin/xcapture ${PREFIX}/bin/xcapture
        install -m 0755 bin/psn ${PREFIX}/bin/psn
        install -m 0755 bin/schedlat ${PREFIX}/bin/schedlat

bertofurth avatar Sep 23 '22 02:09 bertofurth

Thanks for the improvement!

I'll test & include this into the next version too. (Still being a bit swamped time-wise, but have a full-week vacation coming up soon where I intend to work on this project :-)

tanelpoder avatar Sep 23 '22 04:09 tanelpoder

No hurry! Thanks for your work on this project! Have a great vacation.

Berto.

On Fri, 23 Sep 2022, at 14:34, Tanel Poder wrote:

Thanks for the improvement!

I'll test & include this into the next version too. (Still being a bit swamped time-wise, but have a full-week vacation coming up soon where I intend to work on this project :-)

— Reply to this email directly, view it on GitHub https://github.com/tanelpoder/0xtools/issues/31#issuecomment-1255791653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM3N3NAZJ6NRRR2QRBHDVI3V7UXLRANCNFSM6AAAAAAQTS5XTQ. You are receiving this because you authored the thread.Message ID: @.***>

bertofurth avatar Sep 23 '22 22:09 bertofurth

Added into v1.2.3

tanelpoder avatar May 20 '23 04:05 tanelpoder

Well done! Thanks!

bertofurth avatar May 20 '23 09:05 bertofurth