diff options
| author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-10-11 10:04:04 -0600 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-10-11 10:04:04 -0600 |
| commit | 43f06890e2689af2ef54c4480fe5790692a24f65 (patch) | |
| tree | b933f3e05aad81d780c0c94646676efa1bbad22d /Makefile | |
| parent | a74a732b27fb610133190e89a91b2d42d0cf78b3 (diff) | |
| download | cmath-43f06890e2689af2ef54c4480fe5790692a24f65.tar.gz cmath-43f06890e2689af2ef54c4480fe5790692a24f65.zip | |
deprecate common lisp solutions and write c; it's too much effort to keep up with the requirements for an archive.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a76a59f --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +TEST_SRC := test/main.c +SRC_DIR := src +OBJ_DIR := build +BIN_DIR := dist +LIB_DIR := lib + +TEST_EXE := $(BIN_DIR)/lizfcm.test +EXE := $(BIN_DIR)/lizfcm +LIBRARY := $(LIB_DIR)/lizfcm.a +SRC := $(wildcard $(SRC_DIR)/*.c) +OBJ := $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) + +CPPFLAGS := -Iinc -MMD -MP +CFLAGS := -Wall +LDFLAGS := +LDLIBS := -lm + +.PHONY: all clean + +all: $(TEST_EXE) + +$(TEST_EXE): $(LIBRARY) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBRARY) $(TEST_SRC) -o $@ + +$(LIBRARY): $(EXE) + ar rcs $(LIBRARY) $(OBJ_DIR)/*.o + ranlib $(LIBRARY) + +$(EXE): $(OBJ) | $(BIN_DIR) + $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ + +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR) + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ + +$(BIN_DIR) $(OBJ_DIR) $(LIB_DIR): + mkdir -p $@ + +clean: + @$(RM) -r $(BIN_DIR) $(OBJ_DIR) + +-include $(OBJ:.o=.d) |
