21 lines · plain
1C_SOURCES := main.c2 3# Make an archive that has two object files with the same name, but4# different timestamps. Do it all in one rule so that the timestamps5# can be controlled without confusing Make.6libfoo.a: a.c sub1/a.c7 $(CC) $(CFLAGS) -c $(<D)/a.c -o a.o8 mkdir -p sub19 $(CC) $(CFLAGS) -c $(<D)/sub1/a.c -o sub1/a.o10 touch -t '198001010000.00' a.o11 touch -t '198001010000.01' sub1/a.o12 $(AR) $(ARFLAGS) $@ a.o sub1/a.o13 rm a.o sub1/a.o14 15include Makefile.rules16 17# Needs to come after include18OBJECTS += libfoo.a19$(EXE) : libfoo.a20.DEFAULT_GOAL := $(EXE)21