Makefile 1.1 KB

1234567891011121314151617181920212223242526272829
  1. # Adapted from Makefile for Dingux by palxex
  2. TARGET = sdlpal.html
  3. HOST =
  4. CFILES = $(wildcard ../adplug/*.c) $(wildcard ../libmad/*.c) $(wildcard ../liboggvorbis/src/*.c) $(wildcard ../*.c) em.c
  5. CPPFILES = $(wildcard ../adplug/*.cpp) $(wildcard ../*.cpp) $(wildcard ./*.cpp)
  6. OBJFILES = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
  7. CFLAGS = -I${EMSCRIPTEN_TOOLCHAIN}/include/SDL2 -g -Wall -O2 -fno-strict-aliasing -I. -I../ -I../liboggvorbis/include -I../liboggvorbis/src -DPAL_HAS_PLATFORM_SPECIFIC_UTILS
  8. LDFLAGS = -L${EMSCRIPTEN_TOOLCHAIN}/lib -lSDL2 -lm -lstdc++ --preload-file data -s TOTAL_MEMORY=134217728 -s TOTAL_STACK=5242880 --emrun -s DEMANGLE_SUPPORT=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 -s 'EMTERPRETIFY_FILE="sdlpal.bc"'
  9. .c.o:
  10. emcc -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
  11. .cpp.o:
  12. em++ -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
  13. $(TARGET):$(OBJFILES)
  14. em++ $(CFLAGS) -o $(TARGET) $(OBJFILES) $(LDFLAGS)
  15. clean:
  16. rm -f $(OBJFILES)
  17. rm -f $(TARGET) *.bc *.mem *.js *.data *.wast *.wasm
  18. repackage:
  19. rm -f $(TARGET) *.bc *.mem *.js *.data *.wast *.wasm
  20. em++ $(CFLAGS) -o $(TARGET) $(OBJFILES) $(LDFLAGS)