demo3/Makefile

27 lines
351 B
Makefile
Raw Normal View History

2024-11-30 03:06:18 +00:00
CC = gcc
CFLAGS = -O2 -Wall
# 检测操作系统类型
ifeq ($(OS),Windows_NT)
TARGET = decode.exe
RM = del /Q
else
TARGET = decode
RM = rm -f
endif
SRCS = decode.c
OBJS = $(SRCS:.c=.o)
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -c $<
clean:
$(RM) $(OBJS) $(TARGET)