2009-12-30 08:12:17 +08:00
|
|
|
CC = gcc
|
2019-03-28 05:48:46 +08:00
|
|
|
CFLAGS = -std=c99 -Wall -O3 -I.
|
|
|
|
LDFLAGS = -std=c99 -Wall
|
|
|
|
SRC := $(wildcard *.c)
|
|
|
|
OBJ := $(SRC:.c=.o)
|
|
|
|
DEP := $(SRC:.c=.d)
|
|
|
|
PROG := nonce2key
|
2009-12-30 08:12:17 +08:00
|
|
|
|
2019-03-28 05:48:46 +08:00
|
|
|
all: $(PROG)
|
2009-12-30 08:12:17 +08:00
|
|
|
|
2019-03-28 05:48:46 +08:00
|
|
|
$(PROG): $(OBJ)
|
|
|
|
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
2009-12-30 08:12:17 +08:00
|
|
|
|
2019-03-28 05:48:46 +08:00
|
|
|
clean:
|
|
|
|
@$(RM) $(DEP) $(OBJ) $(PROG)
|
2009-12-30 08:12:17 +08:00
|
|
|
|
2019-03-28 05:48:46 +08:00
|
|
|
ifneq ($(filter clean,$(MAKECMDGOALS)),clean)
|
|
|
|
-include $(DEP)
|
|
|
|
endif
|
2009-12-30 08:12:17 +08:00
|
|
|
|
2019-03-28 05:48:46 +08:00
|
|
|
%.d: %.c
|
|
|
|
$(info GEN $@)
|
|
|
|
@$(CC) -MM $(CFLAGS) $< | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
|