Skip to content

Commit

Permalink
Makefile changes to be rebased back
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasballinger committed May 29, 2023
1 parent 3f6c73d commit c272718
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,19 @@ LINK_FLAGS = $(COMMON_FLAGS)\
-s EXPORTED_RUNTIME_METHODS=['callMain']\
--emrun

CPPS := $(shell ls source/*.cpp) $(shell ls source/text/*.cpp)
CPPS_EXCEPT_MAIN := $(shell ls source/*.cpp | grep -v main.cpp) $(shell ls source/text/*.cpp)
CPPS := $(shell ls source/*.cpp) $(shell ls source/text/*.cpp) $(shell ls source/ship/*.cpp)
CPPS_EXCEPT_MAIN := $(shell ls source/*.cpp | grep -v main.cpp) $(shell ls source/text/*.cpp) $(shell ls source/ship/*.cpp)
TEMP := $(subst source/,build/emcc/,$(CPPS))
OBJS := $(subst .cpp,.o,$(TEMP))
TEMP := $(subst source/,build/emcc/,$(CPPS_EXCEPT_MAIN))
OBJS_EXCEPT_MAIN := $(subst .cpp,.o,$(TEMP))
HEADERS := $(shell ls source/*.h*) $(shell ls source/text/*.h*)
HEADERS := $(shell ls source/*.h*) $(shell ls source/text/*.h*) $(shell ls source/ship/*.h*) $(shell ls source/comparators/*.h*)

build/emcc/%.o: source/%.cpp $(HEADERS) libjpeg-turbo-2.1.0/libturbojpeg.a
@mkdir -p build/emcc
@mkdir -p build/emcc/text
@mkdir -p build/emcc/ship
@mkdir -p build/emcc/comparators
$(CXX) $(CFLAGS) -c $< -o $@

lib/emcc/libendless-sky.a: $(OBJS_EXCEPT_MAIN)
Expand Down
21 changes: 21 additions & 0 deletions readme-developer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Building for the web:

Mac and Linux (Windows not supported):

Install Emscripten following the instructions at https://emscripten.org/docs/getting_started/downloads.html
Use the latest version and source the emsdk_env.sh file so you can run commands like emcc, em++ and emmake.
The last time I checked, this looked like:

```
$ git clone https://github.com/emscripten-core/emsdk.git
$ cd emsdk
$ ./emsdk install 3.1.24
$ ./emsdk activate 3.1.24
$ source ./emsdk_env.sh # you'll need to run this one each time you open a new terminal
```

Now back in the endless-sky repo directory run: (maybe you need to install make, wget, and tar first? I figure those should be everywhere already)

```
$ make dev
```

0 comments on commit c272718

Please sign in to comment.