Click here to Skip to main content
15,879,535 members
Home / Discussions / Linux Programming
   

Linux Programming

 
Questiongetting started with ASM, what compilers do you use? Pin
Calin Negru21-Feb-20 1:47
Calin Negru21-Feb-20 1:47 
AnswerRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 1:52
mveRichard MacCutchan21-Feb-20 1:52 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Calin Negru21-Feb-20 2:40
Calin Negru21-Feb-20 2:40 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 3:54
mveRichard MacCutchan21-Feb-20 3:54 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Calin Negru21-Feb-20 6:39
Calin Negru21-Feb-20 6:39 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 6:50
mveRichard MacCutchan21-Feb-20 6:50 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Calin Negru21-Feb-20 7:04
Calin Negru21-Feb-20 7:04 
QuestionCross compilation mystery Pin
fd97504-Feb-20 4:53
professionalfd97504-Feb-20 4:53 
Hi,

I had a nicely operating cross compilation tool setup ( see the article I wrote about it Toolset to Cross Compile/Remote Debug Raspberry from Windows Host[^] )

Today I tried to run a python script but it needed python 3.7. I did not have that in the Msys32 setup I was using. After some searching I tried to put the Msys32 configuration up to date but it completely failed and became totally inoperable. It was not even possible to start the Mingw32 shell in it any more.

I Also had an Msys64 setup available and tried to update that one and it worked perfectly. I installed python 3.8.1.1 and was able to run the python script from within the updated Mingw64 shell. The Msys64 setup also contains a Mingw32 shell which runs equally well.

So far so good but now I have a completely different problem: whenever I try to run the make command for my project ( either manually in the Mingw32 or Mingw64 shell or from Visual studio code ) I get a really odd error message:

$ make
mkdir -p build/./main/
The syntax of the command is incorrect.
make: *** [build/./main/hello_world_main.c.o] Error 1


It is the mkdir -p build/./main/ which appears to be the culprit but strangely enough that used to work perfectly and when I type the exact same command from within either the Mingw32 or Mingw64 shell it executes perfectly without the slightest trace of an error message.

For completeness I have included the Makefile content below but this has really thrown a spanner in the works. Does anyone have an idea as to what may be the cause of this?


TARGET_EXEC ?= Hello_world_c

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

SYSROOT = $(RPIDEV_LOC)/arm-linux-gnueabihf/sysroot
CROSS_COMPILE = $(RPIDEV_LOC)/bin/arm-linux-gnueabihf

CXX = $(CROSS_COMPILE)-g++ --sysroot $(SYSROOT)
CC = $(CROSS_COMPILE)-gcc --sysroot $(SYSROOT) -lpigpio
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 -g

$(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

GeneralRe: Cross compilation mystery Pin
Richard MacCutchan4-Feb-20 6:14
mveRichard MacCutchan4-Feb-20 6:14 
GeneralRe: Cross compilation mystery Pin
k50544-Feb-20 6:53
mvek50544-Feb-20 6:53 
GeneralRe: Cross compilation mystery Pin
Richard MacCutchan4-Feb-20 7:32
mveRichard MacCutchan4-Feb-20 7:32 
GeneralRe: Cross compilation mystery Pin
k50544-Feb-20 8:11
mvek50544-Feb-20 8:11 
GeneralRe: Cross compilation mystery Pin
Richard MacCutchan4-Feb-20 8:43
mveRichard MacCutchan4-Feb-20 8:43 
GeneralRe: Cross compilation mystery Pin
k50544-Feb-20 8:53
mvek50544-Feb-20 8:53 
GeneralRe: Cross compilation mystery Pin
Richard MacCutchan4-Feb-20 9:00
mveRichard MacCutchan4-Feb-20 9:00 
GeneralRe: Cross compilation mystery Pin
fd97504-Feb-20 21:58
professionalfd97504-Feb-20 21:58 
AnswerRe: Cross compilation mystery Pin
fd97504-Feb-20 22:36
professionalfd97504-Feb-20 22:36 
GeneralRe: Cross compilation mystery Pin
Richard MacCutchan4-Feb-20 23:08
mveRichard MacCutchan4-Feb-20 23:08 
QuestionHow to Use SCP Command to Transfer Files/Folders in Linux Pin
Akash Kulkarni20-Jan-20 1:52
Akash Kulkarni20-Jan-20 1:52 
SuggestionRe: How to Use SCP Command to Transfer Files/Folders in Linux Pin
User 275346914-Mar-23 13:57
User 275346914-Mar-23 13:57 
QuestionCross compiling for Raspberry PI from windows host using GTK2.0 library Pin
fd975015-Jan-20 3:37
professionalfd975015-Jan-20 3:37 
AnswerRe: Cross compiling for Raspberry PI from windows host using GTK2.0 library Pin
Eddy Vluggen15-Jan-20 3:45
professionalEddy Vluggen15-Jan-20 3:45 
GeneralRe: Cross compiling for Raspberry PI from windows host using GTK2.0 library Pin
fd975015-Jan-20 4:01
professionalfd975015-Jan-20 4:01 
GeneralRe: Cross compiling for Raspberry PI from windows host using GTK2.0 library Pin
Eddy Vluggen15-Jan-20 6:08
professionalEddy Vluggen15-Jan-20 6:08 
GeneralRe: Cross compiling for Raspberry PI from windows host using GTK2.0 library Pin
k505415-Jan-20 7:52
mvek505415-Jan-20 7:52 

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.