Comments (4)
How? I have no idea which cross compiler you or anyone else will choose to use.
Personally I use a make file called MakeCross.
I use "make -f MakeCross" for soft float and "HF=1 make -f MakeCross -j4" for hard float.
# MakeCross
ifdef HF
CC = arm-linux-gnueabihf-gcc
AR = arm-linux-gnueabihf-ar
RANLIB = arm-linux-gnueabihf-ranlib
SIZE = arm-linux-gnueabihf-size
SHLIB = arm-linux-gnueabihf-gcc -shared
STRIPLIB = arm-linux-gnueabihf-strip --strip-unneeded
else
CC = arm-linux-gnueabi-gcc
AR = arm-linux-gnueabi-ar
RANLIB = arm-linux-gnueabi-ranlib
SIZE = arm-linux-gnueabi-size
SHLIB = arm-linux-gnueabi-gcc -shared
STRIPLIB = arm-linux-gnueabi-strip --strip-unneeded
endif
CFLAGS += -O3 -Wall -pthread
LIB1 = libpigpio.so
OBJ1 = pigpio.o command.o
LIB2 = libpigpiod_if.so
OBJ2 = pigpiod_if.o command.o
LIB3 = libpigpiod_if2.so
OBJ3 = pigpiod_if2.o command.o
LIB = $(LIB1) $(LIB2) $(LIB3)
ALL = $(LIB) x_pigpio x_pigpiod_if x_pigpiod_if2 pig2vcd pigpiod pigs
LL1 = -L. -lpigpio -pthread -lrt
LL2 = -L. -lpigpiod_if -pthread -lrt
LL3 = -L. -lpigpiod_if2 -pthread -lrt
all: $(ALL)
pigpio.o: pigpio.c pigpio.h command.h custom.cext
$(CC) $(CFLAGS) -fpic -c -o pigpio.o pigpio.c
pigpiod_if.o: pigpiod_if.c pigpio.h command.h pigpiod_if.h
$(CC) $(CFLAGS) -fpic -c -o pigpiod_if.o pigpiod_if.c
pigpiod_if2.o: pigpiod_if2.c pigpio.h command.h pigpiod_if2.h
$(CC) $(CFLAGS) -fpic -c -o pigpiod_if2.o pigpiod_if2.c
command.o: command.c pigpio.h command.h
$(CC) $(CFLAGS) -fpic -c -o command.o command.c
x_pigpio: x_pigpio.o $(LIB1)
$(CC) -o x_pigpio x_pigpio.c $(LL1)
x_pigpiod_if: x_pigpiod_if.o $(LIB2)
$(CC) -o x_pigpiod_if x_pigpiod_if.c $(LL2)
x_pigpiod_if2: x_pigpiod_if2.o $(LIB3)
$(CC) -o x_pigpiod_if2 x_pigpiod_if2.c $(LL3)
pigpiod: pigpiod.o $(LIB1)
$(CC) -o pigpiod pigpiod.c $(LL1)
pigs: pigs.o command.o
$(CC) -o pigs pigs.c command.c
pig2vcd: pig2vcd.o
$(CC) -o pig2vcd pig2vcd.c
clean:
rm -f *.o *.i *.s *~ $(ALL)
$(LIB1): $(OBJ1)
$(SHLIB) -o $(LIB1) $(OBJ1)
$(STRIPLIB) $(LIB1)
$(SIZE) $(LIB1)
$(LIB2): $(OBJ2)
$(SHLIB) -o $(LIB2) $(OBJ2)
$(STRIPLIB) $(LIB2)
$(SIZE) $(LIB2)
$(LIB3): $(OBJ3)
$(SHLIB) -o $(LIB3) $(OBJ3)
$(STRIPLIB) $(LIB3)
$(SIZE) $(LIB3)
# generated using gcc -MM *.c
command.o: command.c pigpio.h command.h
pig2vcd.o: pig2vcd.c pigpio.h
pigpio.o: pigpio.c pigpio.h command.h custom.cext
pigpiod.o: pigpiod.c pigpio.h
pigpiod_if.o: pigpiod_if.c pigpio.h command.h pigpiod_if.h
pigpiod_if2.o: pigpiod_if2.c pigpio.h command.h pigpiod_if2.h
pigs.o: pigs.c pigpio.h command.h
x_pigpio.o: x_pigpio.c pigpio.h
x_pigpiod_if.o: x_pigpiod_if.c pigpiod_if.h pigpio.h
x_pigpiod_if2.o: x_pigpiod_if2.c pigpiod_if2.h pigpio.h
from pigpio.
Some way to change the installation base path would be really helpful, as separating the outputs manually is error-prone. Also, many make files allow setting a "compiler command prefix" for use with cross-compilation.
from pigpio.
I have no objection, it's just that my knowledge of makefiles and cross-compilation is severely limited.
Could you prepare a Makefile along the lines of what you want? If all I need to do is replace the current Makefile I would be quite happy to do so, as long as I can understand what it is doing.
from pigpio.
I will close this as an issue until someone has some concrete proposals.
from pigpio.
Related Issues (20)
- pigpio probably won't work on Pi5 (or later Pi's) HOT 4
- Allow get/set of slew rate and hyst bits for gpio HOT 3
- Uninstalling pigpiod attempted to remove /opt
- pigpio will not run on a Pi 5 HOT 16
- Failed on Rpi2 and AlpineLinux HOT 2
- Unclean PWM at certain frequencies. HOT 1
- i2c (am2320) works with pigpio and not pigpiod - could definition of i2c_open() be wrong?
- C pigpio timer inaccuracy on raspbery pi 4 with raspian
- Pigpio BB Serial Read CPU Resource vs. RPI version HOT 4
- Is there a way to flush an open gpioSerialRead buffer? HOT 9
- event_callback with 0 bytes
- Issue with pigpio Initialization on Raspberry Pi 5 Model B HOT 1
- Understanding pigpiod command implementation HOT 9
- Glitch filter active while doing bbSerialRead? HOT 3
- SPI Slave - BSCX not consistently working RPi4B HOT 6
- i2c_open() returns the same handle for two devices on the same bus HOT 37
- Scheduling repetitive SPI writes HOT 3
- Isr doesn't work on raspberry os 12.5 HOT 2
- Continuous Wave Program Concept HOT 6
- SPI6 mode 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pigpio.