| 1 |
C_SOURCES := main.c |
| 2 |
|
| 3 |
# Make an archive that has two object files with the same name, but |
| 4 |
# different timestamps. Do it all in one rule so that the timestamps |
| 5 |
# can be controlled without confusing Make. |
| 6 |
libfoo.a: a.c sub1/a.c |
| 7 |
$(CC) $(CFLAGS) -c $(<D)/a.c -o a.o |
| 8 |
mkdir -p sub1 |
| 9 |
$(CC) $(CFLAGS) -c $(<D)/sub1/a.c -o sub1/a.o |
| 10 |
touch -t '198001010000.00' a.o |
| 11 |
touch -t '198001010000.01' sub1/a.o |
| 12 |
$(AR) $(ARFLAGS) $@ a.o sub1/a.o |
| 13 |
rm a.o sub1/a.o |
| 14 |
|
| 15 |
include Makefile.rules |
| 16 |
|
| 17 |
# Needs to come after include |
| 18 |
OBJECTS += libfoo.a |
| 19 |
$(EXE) : libfoo.a |
| 20 |
.DEFAULT_GOAL := $(EXE) |