hyperultra/Makefile

36 lines
654 B
Makefile
Raw Normal View History

2023-03-17 19:03:59 +01:00
CC := gcc
LD := $(CC)
2023-03-25 21:54:50 +01:00
CFLAGS := -Os -std=c2x -Wall -Wextra -Imap -MMD
2023-03-17 19:03:59 +01:00
LDFLAGS := -lm -lSDL2 -lSDL2_image -lSDL2_mixer
NAME := hyperultra
2023-03-24 23:31:41 +01:00
EMBED := map/maps.h
2023-03-17 19:03:59 +01:00
OBJ := $(patsubst %.c,%.o,$(wildcard src/*.c))
DEP := $(patsubst %.o,%.d,$(OBJ))
all:
@make --no-print-directory $(EMBED)
@make --no-print-directory $(NAME)
$(NAME): $(OBJ)
$(LD) -o $(NAME) $(OBJ) $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
2023-03-24 23:31:41 +01:00
$(EMBED):
tmj2c map/*.tmj >$@
2023-03-17 19:03:59 +01:00
run: re
./$(NAME)
clean:
rm -f $(NAME) $(OBJ) $(DEP) $(EMBED)
re:
@make --no-print-directory clean
@make --no-print-directory all
2023-03-24 23:31:41 +01:00
.PHONY: all run clean re $(EMBED)
2023-03-17 19:03:59 +01:00
-include $(DEP)