23 lines
526 B
Makefile
23 lines
526 B
Makefile
PROGRAM = game
|
|
OBJ = main.o
|
|
CC = gcc
|
|
CC_WASM = /home/user/Git/emsdk/upstream/emscripten/emcc
|
|
CFLAGS = -O2 -g
|
|
LFLAGS = $(shell pkg-config --libs SDL2_image)
|
|
|
|
.PHONY: html
|
|
|
|
all: $(PROGRAM)
|
|
|
|
$(PROGRAM): $(OBJ)
|
|
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LFLAGS)
|
|
|
|
main.o:
|
|
$(CC) $(CFLAGS) -c $(shell pkg-config --cflags sdl2) -o $@ main.c
|
|
|
|
html:
|
|
$(CC_WASM) -O2 -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sSDL2_IMAGE_FORMATS=' ["png"]' -sUSE_SDL_TTF=2 main.c -o html/index.html --shell-file shell.html
|
|
|
|
clean:
|
|
rm -f $(OBJ) $(PROGRAM) html/*
|