forked from nakidai/csnake
1
0
Fork 0
csnake/Makefile

30 lines
568 B
Makefile
Raw Normal View History

include config.mk
2023-10-30 03:00:39 +03:00
INCLUDE = -Iinclude
2023-10-29 20:03:23 +03:00
RM = rm -f
SRCDIR = src
OBJDIR = obj
SRC = main.c screen.c input.c player.c sleep.c platform/getch.c
2023-10-29 20:03:23 +03:00
OBJ = $(addprefix $(OBJDIR)/,$(SRC:.c=.o))
2023-11-25 20:55:57 +03:00
DEFLDFLAGS = $(shell if echo "" | cc -E -dM -xc - | grep __FreeBSD__ > /dev/null 2>&1; then echo "-lpthread"; fi)
2023-11-25 00:55:36 +03:00
all: $(OUT)
2023-10-29 20:03:23 +03:00
obj:
mkdir obj
platform: obj
mkdir obj/platform
2023-10-29 20:03:23 +03:00
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(CC) -c -o $@ $< $(CFLAGS) $(INCLUDE)
$(OUT): obj platform $(OBJ)
2023-11-25 20:55:57 +03:00
$(CC) -o $@ $(OBJ) $(LDFLAGS) $(DEFLDFLAGS)
2023-10-29 20:03:23 +03:00
clean:
$(RM) -r $(OUT) $(OBJDIR)/*
2023-10-29 20:03:23 +03:00
.PHONY: default clean