aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-07-18 07:56:11 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-07-18 07:56:11 +0300
commit36dda991898ce621a0b0f7103f763690e73fa0ff (patch)
treecee197e13a1c42a5ee3ea67465d1151a9c0cc12a /Makefile
parent4d77e4bb69a47daf23ad4a902b300bf1aa7d5597 (diff)
downloadmagi-36dda991898ce621a0b0f7103f763690e73fa0ff.tar
magi-36dda991898ce621a0b0f7103f763690e73fa0ff.tar.xz
magi-36dda991898ce621a0b0f7103f763690e73fa0ff.zip
Docs were extended, consts were added.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 12 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 6803d5a..eaadd6f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Compilation Options
# Debug mode [yes/no] (allowing to debug the library via gdb):
DEBUG ?= no
@@ -6,7 +6,7 @@ DEBUG ?= no
CC ?= gcc
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Preparations
# Compile as ANSI C code:
CFLAGS = -xc -ansi -Wall
@@ -41,30 +41,30 @@ INTER_C = $(INTER_H:.h=.c)
SRC = $(INTER_C) $(EXTER_C)
OBJ = $(foreach o,$(SRC:.c=.o),$(BUILD)/$(o))
# Example executables:
-EXASRC = $(wildcard $(EXADIR)/*.c)
-EXAMPLES = $(foreach x,$(EXASRC:.c=),$(BUILD)/$(x))
+XSRC = $(wildcard $(EXADIR)/*.c)
+EXAMPLES = $(foreach x,$(XSRC:.c=),$(BUILD)/$(x))
# Dependency file:
DEPS = deps.mk
SRCINC = -I$(INCLUDE)/magi
-EXAINC = -I$(INCLUDE)
+XINC = -I$(INCLUDE)
SRCBUILD = $(BUILD)/$(SRCDIR)
-EXABUILD = $(BUILD)/$(EXADIR)
+XBLD = $(BUILD)/$(EXADIR)
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Targets
.PHONY: all examples clean
all: $(SRCBUILD) $(TARGET)
-examples: all $(EXABUILD) $(EXAMPLES)
+examples: all $(XBLD) $(EXAMPLES)
clean:
rm -f $(TARGET) $(OBJ) $(EXAMPLES) $(DEPS)
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Compilation
-include $(DEPS)
@@ -78,13 +78,13 @@ $(BUILD)/%.o: %.c
# Compile executables from corresponding sources and library:
$(BUILD)/%: %.c $(TARGET)
- $(CC) $(CFLAGS) $(EXAINC) $< $(LFLAGS) -o $@
+ $(CC) $(CFLAGS) $(XINC) $< $(LFLAGS) -o $@
# Create build directories, if no such:
-$(SRCBUILD) $(EXABUILD):
+$(SRCBUILD) $(XBLD):
mkdir -p $@
# Generate dependency file, adding corresponding build prefixes:
$(DEPS): $(SRC) $(EXASRC) $(EXTER_H) $(INTER_H) $(INCLUDE)/magi.h
$(CC) $(SRCINC) $(SRC) -MM | sed '/^ /!s#^#$(SRCBUILD)/#' > $@
- $(CC) $(EXAINC) $(EXASRC) -MM | sed '/^ /!s#^#$(EXABUILD)/#;s/\.o//' >> $@
+ $(CC) $(XINC) $(XSRC) -MM | sed '/^ /!s#^#$(XBLD)/#;s/\.o//' >> $@