blob: c43966fc74f2605b8fa1affb9b81bef356e0e5c3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/usr/bin/make
.SUFFIXES:
.PHONY: all run pack clean
TAR = shell prog
SRC = $(wildcard *.c)
OBJ = $(SRC:%.c=%.o)
PCK = lab-2.zip
CFLAGS = -std=gnu11 -c -g -Os -Wall -Werror -MMD -MP
DEP = $(OBJ:%.o=%.d)
-include $(DEP)
%.o: %.c
$(CC) $(CFLAGS) $< -o $@
all: $(TAR)
prog: prog.o
$(CC) -o $@ $^
shell: $(filter-out prog.o,$(OBJ))
$(CC) -o $@ $^
run: all
./shell
pack:
zip $(PCK) $(SRC) $(wildcard *.h) Makefile
clean:
$(RM) $(RMFILES) $(TAR) $(OBJ) $(DEP) $(PCK)
|