http://blog.youkuaiyun.com/liang13664759/article/details/1771246
#*********************************************************
# This makefile is used to create libjia.a library
#*********************************************************
#http://blog.youkuaiyun.com/ziliangxiao/article/details/10309927 for understanding the grammar
CC = gcc
CCC = gcc
FC = f77
SRC = ../../src
CFLAGS = -I./${SRC} $(ARCH_FLAGS) -DDOSTAT -g
OBJS = comm.o init.o mem.o syn.o tools.o exit.o get.o finit.o msg.o load.o
VPATH = ./$(SRC) #importantly, tell make where to search the file
TARGET = libjia.a
%.d: %.c
@echo "Creating $@..."
$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed 's/$*\.o/& $@/g' > $@"
@echo "\n"
%.d: %.f
echo "Creating $@..."
$(SHELL) -ec "$(FC) -c $< | sed ' s/$*\.o/& $@/g' > $@"
$(TARGET):$(OBJS)
ar rv $(TARGET) $?
all:$(TARGET)
clean:
rm -f *.[od] $(TARGET)
include $(OBJS:.o=.d)