Click here to Skip to main content
14,456,102 members

Linux Programming

 
QuestionRunning console apps on windows 7 Pin
fearless_23-Feb-20 21:07
Memberfearless_23-Feb-20 21:07 
AnswerRe: Running console apps on windows 7 Pin
Victor Nijegorodov23-Feb-20 21:45
MemberVictor Nijegorodov23-Feb-20 21:45 
GeneralRe: Running console apps on windows 7 Pin
fearless_23-Feb-20 22:22
Memberfearless_23-Feb-20 22:22 
AnswerRe: Running console apps on windows 7 Pin
Richard MacCutchan23-Feb-20 21:59
communityengineerRichard MacCutchan23-Feb-20 21:59 
GeneralRe: Running console apps on windows 7 Pin
fearless_23-Feb-20 22:21
Memberfearless_23-Feb-20 22:21 
Questiongetting started with ASM, what compilers do you use? Pin
fearless_21-Feb-20 2:47
Memberfearless_21-Feb-20 2:47 
AnswerRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 2:52
communityengineerRichard MacCutchan21-Feb-20 2:52 
GeneralRe: getting started with ASM, what compilers do you use? Pin
fearless_21-Feb-20 3:40
Memberfearless_21-Feb-20 3:40 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 4:54
communityengineerRichard MacCutchan21-Feb-20 4:54 
GeneralRe: getting started with ASM, what compilers do you use? Pin
fearless_21-Feb-20 7:39
Memberfearless_21-Feb-20 7:39 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 7:50
communityengineerRichard MacCutchan21-Feb-20 7:50 
GeneralRe: getting started with ASM, what compilers do you use? Pin
fearless_21-Feb-20 8:04
Memberfearless_21-Feb-20 8:04 
QuestionCross compilation mystery Pin
fd97504-Feb-20 5:53
professionalfd97504-Feb-20 5: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 7:14
communityengineerRichard MacCutchan4-Feb-20 7:14 
GeneralRe: Cross compilation mystery Pin
k50544-Feb-20 7:53
Memberk50544-Feb-20 7:53 
GeneralRe: Cross compilation mystery Pin
Richard MacCutchan4-Feb-20 8:32
communityengineerRichard MacCutchan4-Feb-20 8:32 
GeneralRe: Cross compilation mystery Pin
k50544-Feb-20 9:11
Memberk50544-Feb-20 9:11 
GeneralRe: Cross compilation mystery Pin
Richard MacCutchan4-Feb-20 9:43
communityengineerRichard MacCutchan4-Feb-20 9:43 
GeneralRe: Cross compilation mystery Pin
k50544-Feb-20 9:53
Memberk50544-Feb-20 9:53 
GeneralRe: Cross compilation mystery Pin
Richard MacCutchan4-Feb-20 10:00
communityengineerRichard MacCutchan4-Feb-20 10:00 
GeneralRe: Cross compilation mystery Pin
fd97504-Feb-20 22:58
professionalfd97504-Feb-20 22:58 
AnswerRe: Cross compilation mystery Pin
fd97504-Feb-20 23:36
professionalfd97504-Feb-20 23:36 
GeneralRe: Cross compilation mystery Pin
Richard MacCutchan5-Feb-20 0:08
communityengineerRichard MacCutchan5-Feb-20 0:08 
QuestionHow to Use SCP Command to Transfer Files/Folders in Linux Pin
Akash Kulkarni20-Jan-20 2:52
MemberAkash Kulkarni20-Jan-20 2:52 
AnswerMessage Closed Pin
20-Jan-20 2:55
MemberAkash Kulkarni20-Jan-20 2:55 

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.