summaryrefslogtreecommitdiff
path: root/lab04/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lab04/Makefile')
-rw-r--r--lab04/Makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/lab04/Makefile b/lab04/Makefile
new file mode 100644
index 0000000..dc9f8ab
--- /dev/null
+++ b/lab04/Makefile
@@ -0,0 +1,23 @@
+CC ?= gcc
+CFLAGS ?= -std=gnu11 -Wall -Wextra -O2
+LDLIBS ?= -lm
+
+TARGET := calculator
+SOURCES := main.c ui.c tui.c
+OBJECTS := $(SOURCES:.c=.o)
+
+.PHONY: all clean test
+
+all: $(TARGET)
+
+test:
+ $(MAKE) -C tests run
+
+$(TARGET): $(OBJECTS)
+ $(CC) $(CFLAGS) $(OBJECTS) $(LDLIBS) -o $@
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+clean:
+ rm -f $(TARGET) $(OBJECTS)