diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2024-04-20 02:25:24 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2024-04-20 02:25:24 -0400 |
| commit | 4e332fdfdccd7c617b0eba00e1da9886227eb485 (patch) | |
| tree | a0a75ef47ccdcf0109024e639be36e89b4bb0a26 /makefile | |
| parent | e421022ffbe502bb44393d4a437056a952924cb8 (diff) | |
fixed mandel & multibrot sets, added cli options
Diffstat (limited to 'makefile')
| -rw-r--r-- | makefile | 29 |
1 files changed, 17 insertions, 12 deletions
@@ -3,23 +3,30 @@ CPPFLAGS := CFLAGS := -Wall LDFLAGS := -all: +SRC_DIR := src +BUILD_DIR := build +OBJ_DIR := $(BUILD_DIR)/objects + +TARGET := serial-fractal +SRCS := $(wildcard $(SRC_DIR)/*.c) +OBJS := $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SRCS)) + + +.PHONY: all presentation analysis clean test + +all: $(BUILD_DIR)/$(TARGET) ############## # Programs # ############## -SRCS := mandelbrot.c plotting.c -OBJS := $(SRC:.c=.o) -OBJS_DIR := build/objs - -build/mandelbrot: $(addprefix $(OBJS_DIR)/, $(OBJS)) +build/mandelbrot: $(OBJ_DIR)/serial-fractal.o $(OBJ_DIR)/grids.o $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) -$(OBJS_DIR)/%.o: src/%.c $(OBJS_DIR) - $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR) + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< -$(OBJS_DIR): +$(OBJ_DIR): mkdir -p $@ ################ @@ -44,6 +51,4 @@ analysis: analysis/analysis.html analysis/analysis.html: analysis/analysis.Rmd # TODO: add compile command clean: - rm -rf presentation/presentation.html analysis/analysis.html - -.PHONY: all presentation analysis clean + rm -rf presentation/presentation.html analysis/analysis.html $(OBJS) |
