From 3a14a1851c883806605efaea8268f33d5a239e48 Mon Sep 17 00:00:00 2001 From: jozan Date: Mon, 2 Nov 2020 22:03:54 +0000 Subject: Makefile now working FossilOrigin-Name: 6ac056c0f516ca4e5dd543c370b317e3964c6be912376f446b58a88ebbbee6eb --- Makefile | 61 ++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 21 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2c7ed62..4d851a7 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,55 @@ -default: msan +# ======================== +# ===== =============== +# ====== ================ +# ====== ================ +# ====== ==== ==== == +# ====== === == = = +# ====== === = == = +# = === === = == ==== +# = === === = == = = +# == ===== ==== == +# ======================== +# +# unixize: Makefile +# 2020-11-02 21:43 +# Joe +# +# GNU Makefile -SHELL := /bin/sh +.DEFAULT_GOAL := msan +SHELL := /bin/sh -DESTDIR = /usr/local -SRCS_DIR = src/ -OBJS_DIR = obj/ +DESTDIR = /usr/local +SRCS_DIR = src/ +OBJS_DIR = obj/ -CC = cc -CFLAGS = -std=c89 -CFLAGS += -Wall -CFLAGS += -Wextra -CFLAGS += -Werror -CFLAGS += -pedantic +CC = cc +CFLAGS = -std=c89 +CFLAGS += -Wall +CFLAGS += -Wextra +CFLAGS += -Werror +CFLAGS += -pedantic -RM = rm -f -MKDIR = mkdir -p +RM = rm -rf +MKDIR = mkdir -p -SRCS_NAME = c_unixize +SRCS_NAME = c_unixize -SRCS = $(addprefix ${SRCS_DIR}, $(addsuffix .c, ${SRCS_NAME})) -INCS = $(addprefix ${SRCS_DIR}, $(addsuffix .h, ${SRCS_NAME})) -OBJS = $(patsubst ${SRCS_DIR}%.c, ${OBJS_DIR}%.c.o, ${SRCS}) +SRCS = $(addprefix ${SRCS_DIR}, $(addsuffix .c, ${SRCS_NAME})) +INCS = $(addprefix ${SRCS_DIR}, $(addsuffix .h, ${SRCS_NAME})) +OBJS = $(patsubst ${SRCS_DIR}%.c, ${OBJS_DIR}%.c.o, ${SRCS}) -TARGET = unixize +TARGET = unixize -${OBJS_DIR}%.o: ${SRCS_DIR}%.c ${INCS} Makefile +${OBJS_DIR}%.c.o: ${SRCS_DIR}%.c ${INCS} Makefile @${MKDIR} ${OBJS_DIR} - ${CC} -c ${CFLAGS} $@ $< + ${CC} -c ${CFLAGS} -o $@ $< -all: ${OBJS} +${TARGET}: ${OBJS} ${CC} ${CFLAGS} -o ${TARGET} ${OBJS} +all: ${TARGET} + debug: CFLAGS += -glldb debug: all -- cgit v1.2.3