Nowind, Mac and Linux

Page 4/7
1 | 2 | 3 | | 5 | 6 | 7

By Haohmaru

Paladin (773)

Haohmaru's picture

14-07-2012, 21:21

@Sky_Hawk

\o/

By Edwin

Paragon (1182)

Edwin's picture

14-07-2012, 22:12

For the time being, this also builds nwhostapp.

Makefile:


CXX = g++
LD = ld
RM = rm -f
RMDIR = rm -rf
MAKE = make
CXXFLAGS += -g -Wall
LDFLAGS = 
MKDIR = mkdir -p

general_SOURCES := $(wildcard general/*.cpp)
general_HEADERS := $(wildcard general/*.h)
general_OBJECTS := $(general_SOURCES:%.cpp=%.o)

nwhost_SOURCES := $(wildcard nwhost/*.cpp nwhost/*.cc)
nwhost_HEADERS := $(wildcard nwhost/*.h nwhost/*.hh)
nwhost_OBJECTS := $(nwhost_SOURCES:%.cpp=%.o)
nwhost_OBJECTS := $(nwhost_OBJECTS:%.cc=%.o)
nwhost_INCLUDES:= -Igeneral

ftdx_SOURCES := ftdx/ftdx.cpp ftdx/UsbStream.cpp ftdx/ConLibFtdi.cpp ftdx/ConFtdiSio.cpp
ftdx_HEADERS := $(wildcard ftdx/*.h)
ftdx_OBJECTS := $(ftdx_SOURCES:%.cpp=%.o)
ftdx_INCLUDES:= -Igeneral

nowind_SOURCES := nowind/Attribute.cpp nowind/NwhostService.cpp nowind/nowind.cpp
nowind_HEADERS := $(wildcard nowind/*.h)
nowind_OBJECTS := $(nowind_SOURCES:%.cpp=%.o)
nowind_INCLUDES:= -Igeneral -Inwhost -Iftdx

nwhostapp_SOURCES := $(wildcard nwhostapp/*.cpp)
nwhostapp_HEADERS := $(wildcard nwhostapp/*.h)
nwhostapp_OBJECTS := $(nwhostapp_SOURCES:%.cpp=%.o)
nwhostapp_APPNAME := nwhostapp/nwhostapp
nwhostapp_INCLUDES:= -Igeneral -Inwhost -Iftdx -Inowind
nwhostapp_LIBS    := -lftdi -lboost_system -lboost_filesystem


.PHONY: all clean

all: $(nwhostapp_APPNAME)

clean:
	@echo Cleaning general
	@$(RM) general/*.o
	@echo Cleaning nwhost
	@$(RM) nwhost/*.o
	@echo Cleaning ftdx
	@$(RM) ftdx/*.o
	@echo Cleaning nwhost
	@$(RM) nowind/*.o
	@echo Cleaning nwhostapp
	@$(RM) nwhostapp/*.o $(nwhostapp_APPNAME)

# nwhostapp 


$(nwhostapp_APPNAME): $(general_OBJECTS) $(nwhost_OBJECTS) $(ftdx_OBJECTS) $(nowind_OBJECTS) $(nwhostapp_OBJECTS)
	@echo Linking nwhostapp
	@$(CXX) -o $(nwhostapp_APPNAME) $(nwhostapp_OBJECTS) $(general_OBJECTS) $(nwhost_OBJECTS) \
	           $(ftdx_OBJECTS) $(nowind_OBJECTS)  $(nwhostapp_LIBS)

general/%.o: general/%.cpp $(nwhostapp_HEADERS) $(general_HEADERS) $(nwhost_HEADERS) $(ftdx_HEADERS) $(nowind_HEADERS) 
	@echo Compiling $<
	@$(CXX) -o $@ $(CXXFLAGS) $(nwhostapp_INCLUDES) -c $<

nwhost/%.o: nwhost/%.cpp $(general_HEADERS) $(nwhost_HEADERS)
	@echo Compiling $<
	@$(CXX) -o $@ $(CXXFLAGS) $(nwhostapp_INCLUDES) -c $<

nwhost/%.o: nwhost/%.cc $(general_HEADERS) $(nwhost_HEADERS)
	@echo Compiling $<
	@$(CXX) -o $@ $(CXXFLAGS) $(nwhostapp_INCLUDES) -c $<

ftdx/%.o: ftdx/%.cpp $(general_HEADERS) $(ftdx_HEADERS)
	@echo Compiling $<
	@$(CXX) -o $@ $(CXXFLAGS) $(nwhostapp_INCLUDES) -c $<

nowind/%.o: nowind/%.cpp $(general_HEADERS) $(nwhost_HEADERS) $(ftdx_HEADERS) $(nowind_HEADERS) 
	@echo Compiling $<
	@$(CXX) -o $@ $(CXXFLAGS) $(nwhostapp_INCLUDES) -c $<

nwhostapp/%.o: nwhostapp/%.cpp $(general_HEADERS) $(nwhost_HEADERS) $(ftdx_HEADERS) $(nowind_HEADERS) $(nwhostapp_HEADERS)
	@echo Compiling $<
	@$(CXX) -o $@ $(CXXFLAGS) $(nwhostapp_INCLUDES) -c $<

By Haohmaru

Paladin (773)

Haohmaru's picture

21-07-2012, 13:39

Yay.

Now that I finally have some time to attempt this again...

How is this supposed to work? Am I missing something? Should I have read the 32567-page manual in Hebrew before cooking an egg?

I mean. Replacing the Makefile in the nwhostapp directory after doing the cmake -G 'Unix Makefiles' thing does not change anything, I get the same errors as before.

Tongue

By Haohmaru

Paladin (773)

Haohmaru's picture

21-07-2012, 14:01

Also, I noticed

[ 69%] Building CXX Object ftdx/CMakeFiles/ftdx.dir/ConFTD2XX.cpp.o
/home/haohmaru/nowindlibraries-read-only/ftdx/ConFTD2XX.cpp: In constructor 'ftdx::ConFTD2XX::ConFTD2XX()':
/home/haohmaru/nowindlibraries-read-only/ftdx/ConFTD2XX.cpp:52:63: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat]

While scrolling back a bit more after the cmake -G 'Unix Makefiles' command spewed out it's ftdx-related error messages...

By Manuel

Ascended (18133)

Manuel's picture

21-07-2012, 21:46

Haohmaru: you replaced the Makefile and typed make?

By Haohmaru

Paladin (773)

Haohmaru's picture

21-07-2012, 22:15

step 1: c/p Edwin's quoted voodoo, save to EDWIN-Makefile_voodoo
step 2: cmake -G 'Unix Makefiles'
step 3: replace Makefile in nwhostapp with EDWIN-Makefile_voodoo
step 4: make

... because I do not only need nwhostapp, but the other things compiled as well for everything to work.

Also, doing cmake -G 'Unix Makefiles' AFTER replacing the nwhostapp Makefile will result in Edwin's makefile being overwritten.

By Manuel

Ascended (18133)

Manuel's picture

21-07-2012, 23:19

All I can say is: contact Sky_hawk/Jan.

By Edwin

Paragon (1182)

Edwin's picture

22-07-2012, 09:34

Haohmaru: I may have been a bit short with that. I made that when cmake didn't work for me and just bypassed the whole thing.

Step 1: put the "Makefile" in the base directory. (it shouldn't really replace anything because cmake uses its own name)
Step 2: type "make" from that directory.
Step 3: find your app in the nwhostapp directory.

By Sky_hawk

Champion (267)

Sky_hawk's picture

22-07-2012, 11:18

In have not installEd ubuntu 12 yet, but if you want to help solve the problem, we should find ou why cmake is not adding -lftdi to the linker options. If i have an answer i will post it here.

Gr,

Jan

By Haohmaru

Paladin (773)

Haohmaru's picture

22-07-2012, 14:45

@Edwin:

Ok I placed your Makefile into a fresh nowindlibraries-read-only directory and:

haohmaru@tokoloshe:~/nowindlibraries-read-only$ make
Compiling general/BasicType.cpp
Compiling general/general.cpp
Compiling general/Util.cpp
Compiling nwhost/Image.cpp
Compiling nwhost/ImageHandler.cpp
Compiling nwhost/NowindHostDebug.cpp
Compiling nwhost/NowindHostSupportDebug.cpp
Compiling nwhost/nowindusb.cpp
nwhost/nowindusb.cpp:22:23: warning: ‘mDataAvailable_callback’ defined but not used [-Wunused-variable]
Compiling nwhost/nwhost.cpp
Compiling nwhost/PartitionInfo.cpp
Compiling nwhost/BDOSProxy.cc
Compiling nwhost/BlockRead.cc
Compiling nwhost/BlockWrite.cc
nwhost/BlockWrite.cc: In member function ‘void nwhost::BlockWrite::continueWithNextBlock()’:
nwhost/BlockWrite.cc:111:14: warning: unused variable ‘transferSize’ [-Wunused-variable]
nwhost/BlockWrite.cc: In member function ‘void nwhost::BlockWrite::requestBlock(nwhost::word, nwhost::word)’:
nwhost/BlockWrite.cc:123:15: warning: unused variable ‘endAddress’ [-Wunused-variable]
Compiling nwhost/Command.cc
nwhost/Command.cc: In member function ‘void nwhost::Command::reportCpuInfo() const’:
nwhost/Command.cc:74:10: warning: unused variable ‘mainSS’ [-Wunused-variable]
nwhost/Command.cc:75:10: warning: unused variable ‘fcc5’ [-Wunused-variable]
nwhost/Command.cc:76:10: warning: unused variable ‘fcc7’ [-Wunused-variable]
Compiling nwhost/DataBlock.cc
Compiling nwhost/DataBlockWrite.cc
Compiling nwhost/Device.cc
Compiling nwhost/NowindHost.cc
nwhost/NowindHost.hh: In constructor ‘nwhost::NowindHost::NowindHost(const std::vector&)’:
nwhost/NowindHost.hh:229:24: warning: ‘nwhost::NowindHost::nwhSupport’ will be initialized after [-Wreorder]
nwhost/NowindHost.hh:206:7: warning:   ‘nwhost::byte nwhost::NowindHost::driveOffset’ [-Wreorder]
nwhost/NowindHost.cc:79:1: warning:   when initialized here [-Wreorder]
nwhost/NowindHost.cc: In member function ‘std::string nwhost::NowindHost::nowMap(std::string)’:
nwhost/NowindHost.cc:656:111: warning: too many arguments for format [-Wformat-extra-args]
Compiling nwhost/NowindHostSupport.cc
Compiling nwhost/ReceiveRegisters.cc
Compiling nwhost/Response.cc
Compiling ftdx/ftdx.cpp
Compiling ftdx/UsbStream.cpp
Compiling ftdx/ConLibFtdi.cpp
Compiling ftdx/ConFtdiSio.cpp
Compiling nowind/Attribute.cpp
Compiling nowind/NwhostService.cpp
nowind/NwhostService.cpp: In static member function ‘static void nowind::NwhostService::statStopMeasument(unsigned int)’:
nowind/NwhostService.cpp:462:16: warning: unused variable ‘lKbps’ [-Wunused-variable]
Compiling nowind/nowind.cpp
Compiling nwhostapp/HostApp.cpp
Compiling nwhostapp/mainUsbHost.cpp
Linking nwhostapp

Well nwhostapp is now compiled and I can execute it and check out it's available commands!

So I hooked up my HB-75P, plugged in the Nowind and fired up the MSX with the 'F'-key pressed.
Then I did a ./nwhostapp -f ~/Downloads/nowind.rom and plugged in the USB cable when asked to do so.
The nothing happened.
I tried again with a ./nwhostapp -i ~/Documents/MSX/DSK/demos/Alankomaat\ -\ Bandwagon\ \2000\).dsk and nothing happened.

Sad

I assume this is because of the warnings that were spewed out during make?

Page 4/7
1 | 2 | 3 | | 5 | 6 | 7