diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2020-07-18 07:56:11 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2020-07-18 07:56:11 +0300 |
commit | 36dda991898ce621a0b0f7103f763690e73fa0ff (patch) | |
tree | cee197e13a1c42a5ee3ea67465d1151a9c0cc12a /Makefile | |
parent | 4d77e4bb69a47daf23ad4a902b300bf1aa7d5597 (diff) | |
download | magi-36dda991898ce621a0b0f7103f763690e73fa0ff.tar magi-36dda991898ce621a0b0f7103f763690e73fa0ff.tar.xz magi-36dda991898ce621a0b0f7103f763690e73fa0ff.zip |
Docs were extended, consts were added.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -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//' >> $@ |