|
| 1 | +# 확장자 규칙 |
1 | 2 | .SUFFIXES: .c .o
|
| 3 | +.PHONY: clean |
2 | 4 |
|
3 | | -TARGET = ssu_mntr |
4 | | -CC = gcc |
5 | | -CFLAGS = -g -Wall -Wextra -c |
6 | | -INC = |
| 5 | +# Compiler |
| 6 | +CC = gcc |
| 7 | +# Compile option |
| 8 | +CFLAGS = -c -W -Wall -Wextra -g |
7 | 9 |
|
8 | | -OBJECTS = support.o monitoring.o prompt.o ssu_mntr.o |
| 10 | +# Execute program file |
| 11 | +TARGET = ssu_mntr |
| 12 | +# Source file |
9 | 13 | SRCS = support.c monitoring.c prompt.c ssu_mntr.c
|
| 14 | +# Object file |
| 15 | +OBJECTS = support.o monitoring.o prompt.o ssu_mntr.o |
| 16 | +# Header file |
| 17 | +HDRS = common.h monitoring.h prompt.h |
10 | 18 |
|
| 19 | +# Execute program file generation |
11 | 20 | $(TARGET): $(OBJECTS)
|
12 | 21 | $(CC) -o $(TARGET) $(OBJECTS)
|
13 | 22 |
|
14 | | -$(OBJECTS): common.h monitoring.h prompt.h |
| 23 | +$(OBJECTS): $(HDRS) |
15 | 24 | $(CC) $(CFLAGS) $(SRCS)
|
16 | 25 |
|
17 | | -.c.o: |
18 | | - $(cc) $(INC) $(CFLAGS) |
| 26 | +# .c|.o를 만날 경우 |
| 27 | +#.c.o: |
| 28 | +# $(cc) $(CFLAGS) $(SRCS) |
| 29 | + |
| 30 | +# make all |
| 31 | +all: |
| 32 | + $(TARGET) clean |
19 | 33 |
|
| 34 | +# make clean |
20 | 35 | clean:
|
21 | | - rm $(OBJECTS) $(TARGET) |
| 36 | + rm -rf $(OBJECTS) $(TARGET) |
22 | 37 |
|
23 | 38 |
|
0 commit comments