Click here to Skip to main content
14,266,139 members

Linux Programming

 
GeneralRe: How does perror works? Pin
Vaclav_8-Mar-19 5:34
memberVaclav_8-Mar-19 5:34 
GeneralRe: How does perror works? Pin
Richard MacCutchan8-Mar-19 5:43
protectorRichard MacCutchan8-Mar-19 5:43 
QuestionOption “bluez” “configure “ for specific architecture Pin
Vaclav_6-Mar-19 11:56
memberVaclav_6-Mar-19 11:56 
AnswerRe: Option “bluez” “configure “ for specific architecture Pin
k50546-Mar-19 11:59
memberk50546-Mar-19 11:59 
GeneralRe: Option “bluez” “configure “ for specific architecture Pin
Vaclav_6-Mar-19 14:26
memberVaclav_6-Mar-19 14:26 
QuestionAnyone know of a good explanation on cross compiling for the raspberry PI from the Windows (Mingw32 ) Command line Pin
fd97505-Mar-19 23:12
professionalfd97505-Mar-19 23:12 
AnswerRe: Anyone know of a good explanation on cross compiling for the raspberry PI from the Windows (Mingw32 ) Command line Pin
Vaclav_6-Mar-19 3:33
memberVaclav_6-Mar-19 3:33 
GeneralRe: Anyone know of a good explanation on cross compiling for the raspberry PI from the Windows (Mingw32 ) Command line Pin
fd97506-Mar-19 4:21
professionalfd97506-Mar-19 4:21 
Ain't that the truth, like anything to do with Linux you find bits and pieces at various locations but nothing solid.

I the mean time I have cobbled some things together and I am able to run a make command which appears to produce an output but I am not sure yet it runs on a raspberry PI.

Anyway: I can run "make" which uses this makefile:

TARGET_EXEC ?= a.out

BUILD_DIR ?= ./build
SRC_DIRS ?= ./main

SYSROOT = /c/msys32/home/RPI/SysGCC/arm-linux-gnueabihf/sysroot
CROSS_COMPILE = /C/msys32/home/RPI/SysGCC/bin/arm-linux-gnueabihf

CXX = $(CROSS_COMPILE)-g++ --sysroot $(SYSROOT)
CC = $(CROSS_COMPILE)-gcc --sysroot $(SYSROOT)
AS = $(CROSS_COMPILE)-as
AR = $(CROSS_COMPILE)-ar
NM = $(CROSS_COMPILE)-nm
LD = $(CROSS_COMPILE)-ld

SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s)
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:.o=.d)

INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))

CPPFLAGS ?= $(INC_FLAGS) -MMD -MP

$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
	$(CC) $(OBJS) -o $@ $(LDFLAGS)

# assembly
$(BUILD_DIR)/%.s.o: %.s
	$(MKDIR_P) $(dir $@)
	$(AS) $(ASFLAGS) -c $< -o $@

# c source
$(BUILD_DIR)/%.c.o: %.c
	$(MKDIR_P) $(dir $@)
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

# c++ source
$(BUILD_DIR)/%.cpp.o: %.cpp
	$(MKDIR_P) $(dir $@)
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@


.PHONY: clean

clean:
	$(RM) -r $(BUILD_DIR)

-include $(DEPS)

MKDIR_P ?= mkdir -p

Most of it comes from here:

A Super-Simple Makefile for Medium-Sized C/C++ Projects[^]

It has some merits as it automatically finds and builds any "c" files located in the "main" directory as specified and any "c" files in any subdirectories.

The bit with the SYSROOT comes from here:
http://www.lilug.org/w/images/e/e6/T_Rothamel_Presentation_CrossCompiling_8_Jul_2014.pdf[^]

It appears to build my hello_world_main.c in directory main, my test.c file in directory main/test and produces the specified a.out file in the Build directory. During the process it calls the necessary arm-linux-gnueabihf-gcc cross development tool so I guess it might just be an operational executable for the Raspberry PI. I will know more tomorrow.
GeneralRe: Anyone know of a good explanation on cross compiling for the raspberry PI from the Windows (Mingw32 ) Command line Pin
Vaclav_6-Mar-19 4:28
memberVaclav_6-Mar-19 4:28 
GeneralRe: Anyone know of a good explanation on cross compiling for the raspberry PI from the Windows (Mingw32 ) Command line Pin
fd97506-Mar-19 5:37
professionalfd97506-Mar-19 5:37 
GeneralRe: Anyone know of a good explanation on cross compiling for the raspberry PI from the Windows (Mingw32 ) Command line Pin
fd97506-Mar-19 21:05
professionalfd97506-Mar-19 21:05 
GeneralRe: Anyone know of a good explanation on cross compiling for the raspberry PI from the Windows (Mingw32 ) Command line Pin
Vaclav_7-Mar-19 3:36
memberVaclav_7-Mar-19 3:36 
GeneralRe: Anyone know of a good explanation on cross compiling for the raspberry PI from the Windows (Mingw32 ) Command line Pin
fd97507-Mar-19 4:25
professionalfd97507-Mar-19 4:25 
QuestionSOLVED Developing bluetooth app using "bluez" package (FROM SOURCE ) Pin
Vaclav_5-Mar-19 5:18
memberVaclav_5-Mar-19 5:18 
AnswerRe: Developing bluetooth app using "bluez" Pin
Richard MacCutchan5-Mar-19 6:32
protectorRichard MacCutchan5-Mar-19 6:32 
GeneralRe: Developing bluetooth app using "bluez" Pin
Vaclav_5-Mar-19 6:46
memberVaclav_5-Mar-19 6:46 
GeneralRe: Developing bluetooth app using "bluez" Pin
Richard MacCutchan5-Mar-19 6:50
protectorRichard MacCutchan5-Mar-19 6:50 
GeneralRe: Developing bluetooth app using "bluez" Pin
Vaclav_5-Mar-19 9:03
memberVaclav_5-Mar-19 9:03 
GeneralRe: Developing bluetooth app using "bluez" Pin
Richard MacCutchan5-Mar-19 22:45
protectorRichard MacCutchan5-Mar-19 22:45 
GeneralRe: Developing bluetooth app using "bluez" Pin
Vaclav_5-Mar-19 7:39
memberVaclav_5-Mar-19 7:39 
AnswerRe: Developing bluetooth app using "bluez" Pin
k50545-Mar-19 9:44
memberk50545-Mar-19 9:44 
GeneralRe: Developing bluetooth app using "bluez" Pin
Vaclav_5-Mar-19 13:37
memberVaclav_5-Mar-19 13:37 
GeneralRe: Developing bluetooth app using "bluez" Pin
k50546-Mar-19 6:57
memberk50546-Mar-19 6:57 
GeneralRe: Developing bluetooth app using "bluez" Pin
Vaclav_5-Mar-19 16:02
memberVaclav_5-Mar-19 16:02 
GeneralRe: Developing bluetooth app using "bluez" Pin
k50546-Mar-19 8:50
memberk50546-Mar-19 8:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.