aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 7 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 44c7a9c..dabbf60 100644
--- a/Makefile
+++ b/Makefile
@@ -3,27 +3,23 @@ MKDIR = mkdir -p
NAME = cardioid
-SRCDIR = src
-INCDIR = inc
-OBJDIR = obj
-
CC = gcc
CCFLAGS = -Wall -Wextra -I$(INCDIR) $(shell sdl2-config --cflags)
LDFLAGS = $(shell sdl2-config --libs) -lm
-SRC = $(shell find $(SRCDIR) -type f -name "*.c")
-INC = $(shell find $(INCDIR) -type f -name "*.h")
-OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
+SRC = $(shell find . -type f -name "*.c")
+INC = $(shell find . -type f -name "*.h")
+OBJ = $(SRC:.c=.o)
-all: prebuild $(NAME)
+all: $(NAME)
-prebuild:
- $(MKDIR) $(OBJDIR)
+release: CCFLAGS += -D CARDIOID_RELEASE -Ofast
+release: re
$(NAME): $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS)
-$(OBJDIR)/%.o: $(SRCDIR)/%.c $(INC)
+%.o: %.c $(INC)
$(CC) $(CCFLAGS) -c -o $@ $<
clean: