aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 14 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 508c7de..b3e5061 100644
--- a/Makefile
+++ b/Makefile
@@ -1,33 +1,24 @@
-all: t1_a t1_b t23 test.so
+CFLAGS = -O2 -Wall -Wextra -Werror -Iinclude
-T2FLAGS := -Wall
+all: task4
-ifneq ($(OS),Windows_NT)
- T2FLAGS += -DDYNAMIC_LOAD
- T2LINKS = -lm -ldl
- ifneq (, $(shell which gnuplot))
- T2FLAGS += -DPIPE_GNUPLOT
- ifeq (, ${DISPLAY})
- T2FLAGS += -DTERMINAL_PLOT
- endif
- endif
-endif
+build:
+ mkdir -p build
-t1_a: main_1.c
- $(CC) -DPROG_SINUS_SUM $^ -o $@
+build/roots.o: src/roots.c build
+ $(CC) $(CFLAGS) -c -o $@ $<
-t1_b: main_1.c
- $(CC) -DPROG_MONTE_CARLO $^ -o $@
+build/integral.o: src/integral.c build
+ $(CC) $(CFLAGS) -c -o $@ $<
-t23: main_23.c
- $(CC) $(T2FLAGS) $^ -o $@ $(T2LINKS)
+task4: build/roots.o build/integral.o src/main.c
+ $(CC) $(CFLAGS) -o $@ $^ -lm -ldl
-test.so: test_f.c
- $(CC) -fPIC -fPIE -shared $^ -o $@
+.PHONY: run clean
-.PHONY: clean
+run: task4
+ ./task4
clean:
- rm -rf t1_a t1_b t23 test.so
-
+ rm -f build/*.o task4