We don't currently integrate with Code::Blocks in any way to seamlessly target Emscripten/JS with that IDE. I'm not sure if that is possible with Code::Blocks, but if someone who has detailed experience with Code::Blocks and wants to give that a go, that would probably be a nice project to try.
If I understand correctly, it looks like you were able to export the Code::Blocks project to a Makefile? Emscripten supports makefiles in the sense that emcc and em++ function as drop-in replacements for gcc and g++. This means you can try set up that Makefile to build with Emscripten by replacing CC=emcc, CXX=em++, AR=emar, LD=em++ at the top of the Makefile, and run 'emmake make', or simply 'make' at the command line to run that through Emscripten. Also, another change you will need to do is to give the output executable a suffix either '.html' or '.js'. If I'm reading the Makefile correctly, this means setting OUT_RELEASE=bin/Release/sets.html . This is because emac detects by the output file which type of compilation it's doing (compiling to static library, bitcode, or output html/js). 2014-12-02 12:34 GMT-08:00 Gilles Dubois <[email protected]>: > Hi everybody ! > I understood (if not in detail, at least in practice) how to use > emscripten tools to produce web executables from single cpp files. > OK ! Now I would try this for real. > I have a C++ programm written with the code::blocks IDE. Structure is > quite usual with src and include directories. > I use SDL library with extensions SDL_image, SDL_ttf, SDL_mixer, etc... > I have a few home-made C++ classes defined from .h and corresponding .cpp > files with appropriate #include (s) to the headers of SDL > I can produce a makefile from this using the cbp2make utility. > Now I tried to read the doc but wasn't able to understand the global > procedure (projects compiling). I only understood that I should first > produce .bc files and joined them but how ??? > Can somebody help me with a detailed step-by-step procedure (tutorial). > For information my makefile is copied here. > Thank you ! > Gilles > > #------------------------------------------------------------------------------# > # This makefile was generated by 'cbp2make' tool > rev.147 # > > #------------------------------------------------------------------------------# > > > WORKDIR = `pwd` > > CC = gcc > CXX = g++ > AR = ar > LD = g++ > WINDRES = windres > > INC = > CFLAGS = -Wall `sdl-config --cflags` -lSDL_ttf -lSDL_mixer -lSDL_image > RESINC = > LIBDIR = > LIB = > LDFLAGS = `sdl-config --libs` -lSDL_ttf -lSDL_mixer -lSDL_image > > INC_DEBUG = $(INC) -Iinclude > CFLAGS_DEBUG = $(CFLAGS) -g > RESINC_DEBUG = $(RESINC) > RCFLAGS_DEBUG = $(RCFLAGS) > LIBDIR_DEBUG = $(LIBDIR) > LIB_DEBUG = $(LIB) > LDFLAGS_DEBUG = $(LDFLAGS) > OBJDIR_DEBUG = obj/Debug > DEP_DEBUG = > OUT_DEBUG = bin/Debug/sets > > INC_RELEASE = $(INC) -Iinclude > CFLAGS_RELEASE = $(CFLAGS) -O2 > RESINC_RELEASE = $(RESINC) > RCFLAGS_RELEASE = $(RCFLAGS) > LIBDIR_RELEASE = $(LIBDIR) > LIB_RELEASE = $(LIB) > LDFLAGS_RELEASE = $(LDFLAGS) -s > OBJDIR_RELEASE = obj/Release > DEP_RELEASE = > OUT_RELEASE = bin/Release/sets > > OBJ_DEBUG = $(OBJDIR_DEBUG)/main.o $(OBJDIR_DEBUG)/src/button.o > $(OBJDIR_DEBUG)/src/element.o $(OBJDIR_DEBUG)/src/globals.o > $(OBJDIR_DEBUG)/src/set.o > > OBJ_RELEASE = $(OBJDIR_RELEASE)/main.o $(OBJDIR_RELEASE)/src/button.o > $(OBJDIR_RELEASE)/src/element.o $(OBJDIR_RELEASE)/src/globals.o > $(OBJDIR_RELEASE)/src/set.o > > all: debug release > > clean: clean_debug clean_release > > before_debug: > test -d bin/Debug || mkdir -p bin/Debug > test -d $(OBJDIR_DEBUG) || mkdir -p $(OBJDIR_DEBUG) > test -d $(OBJDIR_DEBUG)/src || mkdir -p $(OBJDIR_DEBUG)/src > > after_debug: > > debug: before_debug out_debug after_debug > > out_debug: before_debug $(OBJ_DEBUG) $(DEP_DEBUG) > $(LD) $(LIBDIR_DEBUG) -o $(OUT_DEBUG) $(OBJ_DEBUG) $(LDFLAGS_DEBUG) > $(LIB_DEBUG) > > $(OBJDIR_DEBUG)/main.o: main.cpp > $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c main.cpp -o > $(OBJDIR_DEBUG)/main.o > > $(OBJDIR_DEBUG)/src/button.o: src/button.cpp > $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/button.cpp -o > $(OBJDIR_DEBUG)/src/button.o > > $(OBJDIR_DEBUG)/src/element.o: src/element.cpp > $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/element.cpp -o > $(OBJDIR_DEBUG)/src/element.o > > $(OBJDIR_DEBUG)/src/globals.o: src/globals.cpp > $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/globals.cpp -o > $(OBJDIR_DEBUG)/src/globals.o > > $(OBJDIR_DEBUG)/src/set.o: src/set.cpp > $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c src/set.cpp -o > $(OBJDIR_DEBUG)/src/set.o > > clean_debug: > rm -f $(OBJ_DEBUG) $(OUT_DEBUG) > rm -rf bin/Debug > rm -rf $(OBJDIR_DEBUG) > rm -rf $(OBJDIR_DEBUG)/src > > before_release: > test -d bin/Release || mkdir -p bin/Release > test -d $(OBJDIR_RELEASE) || mkdir -p $(OBJDIR_RELEASE) > test -d $(OBJDIR_RELEASE)/src || mkdir -p $(OBJDIR_RELEASE)/src > > after_release: > > release: before_release out_release after_release > > out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) > $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) > $(LDFLAGS_RELEASE) $(LIB_RELEASE) > > $(OBJDIR_RELEASE)/main.o: main.cpp > $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c main.cpp -o > $(OBJDIR_RELEASE)/main.o > > $(OBJDIR_RELEASE)/src/button.o: src/button.cpp > $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/button.cpp -o > $(OBJDIR_RELEASE)/src/button.o > > $(OBJDIR_RELEASE)/src/element.o: src/element.cpp > $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/element.cpp -o > $(OBJDIR_RELEASE)/src/element.o > > $(OBJDIR_RELEASE)/src/globals.o: src/globals.cpp > $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/globals.cpp -o > $(OBJDIR_RELEASE)/src/globals.o > > $(OBJDIR_RELEASE)/src/set.o: src/set.cpp > $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c src/set.cpp -o > $(OBJDIR_RELEASE)/src/set.o > > clean_release: > rm -f $(OBJ_RELEASE) $(OUT_RELEASE) > rm -rf bin/Release > rm -rf $(OBJDIR_RELEASE) > rm -rf $(OBJDIR_RELEASE)/src > > .PHONY: before_debug after_debug clean_debug before_release after_release > clean_release > > > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
