minimake/Makefile

35 lines
708 B
Makefile
Raw Permalink Normal View History

2025-10-27 11:14:41 +01:00
CC = gcc
CFLAGS = -std=c99 -pedantic -Werror -Wall -Wextra -Wvla
2025-10-27 19:29:04 +01:00
LDFLAGS=
2025-10-27 11:14:41 +01:00
DBG_CFLAGS = -fsanitize=address -g
2025-10-27 19:29:04 +01:00
DBG_LDFLAGS= -fsanitize=address
2025-10-24 23:16:13 +02:00
2025-10-27 11:14:41 +01:00
SRC_DIR = src
2025-10-31 21:34:09 +01:00
LIB_SRCS = lines/lines.c hash_maps/hash_maps.c lists/lists.c files/files.c
2025-10-27 11:14:41 +01:00
MAIN_SRCS = main.c minimake.c
# SRCS = $(patsubst %,$(SRC_DIR)/%, $(MAIN_SRCS))
SRCS = $(MAIN_SRCS:%=$(SRC_DIR)/%) $(LIB_SRCS:%=$(SRC_DIR)/%)
OBJS = $(SRCS:.c=.o)
TARGET= minimake
# DBG_TARGET = minimake-dbg
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
@echo $(OBJS)
2025-10-31 23:12:01 +01:00
debug: CFLAGS += $(DBG_CFLAGS)
debug: LDFLAGS += $(DBG_LDFLAGS)
debug: $(OBJS)
$(CC) -o $(TARGET) $^ $(LDFLAGS) $(LDLIBS)
2025-10-27 11:14:41 +01:00
2025-10-27 19:56:40 +01:00
check:
dash ./tests/run.sh
2025-10-27 11:14:41 +01:00
clean:
$(RM) $(TARGET)
$(RM) $(OBJS)