diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..635e04e --- /dev/null +++ b/Makefile | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | SRC = minesweeper.ha | ||
| 2 | OBJ = minesweeper | ||
| 3 | |||
| 4 | RAYLIB = -Lraylib -lraylib -lm | ||
| 5 | |||
| 6 | UNAME = $(shell uname) | ||
| 7 | ifeq ($(UNAME), OpenBSD) | ||
| 8 | GNUMAKE = gmake | ||
| 9 | IRAY = EXTRA_INCLUDE_PATHS='-I/usr/X11R6/include' | ||
| 10 | LRAY = CUSTOM_LDFLAGS='-L/usr/X11R6/lib' | ||
| 11 | GRAY = 'GRAPHICS = GRAPHICS_API_OPENGL_21' # My OpenBSD laptop is a potato | ||
| 12 | else | ||
| 13 | GNUMAKE = make | ||
| 14 | endif | ||
| 15 | |||
| 16 | all: raylib/libraylib.a | ||
| 17 | hare build -o ${OBJ} ${RAYLIB} ${SRC} | ||
| 18 | |||
| 19 | raylib/libraylib.a: | ||
| 20 | cd raylib/src && $(GNUMAKE) $(GRAY) $(IRAY) $(LRAY) $(RAYP) | ||
| 21 | cp raylib/src/libraylib.a raylib/ | ||
| 22 | cd raylib/src && $(GNUMAKE) clean | ||
| 23 | |||
| 24 | run: raylib/libraylib.a | ||
| 25 | hare run $(RAYLIB) $(SRC) | ||
| 26 | |||
| 27 | test: raylib/libraylib.a | ||
| 28 | hare test $(RAYLIB) $(SRC) | ||
| 29 | |||
| 30 | clean: | ||
| 31 | rm -f $(OBJ) | ||
| 32 | rm -f raylib/libraylib.a | ||
| 33 | cd raylib/src && $(GNUMAKE) clean | ||
| 34 | |||
| 35 | .PHONY: all run clean | ||
