root / rules.mak @ 9ea37780
History | View | Annotate | Download (1.4 kB)
1 | 17759187 | aliguori | |
---|---|---|---|
2 | 5ab28867 | Juan Quintela | # Don't use implicit rules or variables |
3 | 5ab28867 | Juan Quintela | # we have explicit rules for everything |
4 | 5ab28867 | Juan Quintela | MAKEFLAGS += -rR |
5 | 5ab28867 | Juan Quintela | |
6 | 5ab28867 | Juan Quintela | # Files with this suffixes are final, don't try to generate them |
7 | 5ab28867 | Juan Quintela | # using implicit rules |
8 | 5ab28867 | Juan Quintela | %.d: |
9 | 5ab28867 | Juan Quintela | %.h: |
10 | 5ab28867 | Juan Quintela | %.c: |
11 | 5ab28867 | Juan Quintela | %.m: |
12 | 5ab28867 | Juan Quintela | %.mak: |
13 | 5ab28867 | Juan Quintela | |
14 | 7ebf54bc | Stefan Weil | # Flags for dependency generation |
15 | 7ebf54bc | Stefan Weil | QEMU_DGFLAGS += -MMD -MP -MT $@ |
16 | 02d5467e | malc | |
17 | f527c579 | Juan Quintela | %.o: %.c $(GENERATED_HEADERS) |
18 | 7ebf54bc | Stefan Weil | $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") |
19 | 17759187 | aliguori | |
20 | 17759187 | aliguori | %.o: %.S |
21 | 7ebf54bc | Stefan Weil | $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@") |
22 | 17759187 | aliguori | |
23 | 17759187 | aliguori | %.o: %.m |
24 | 7ebf54bc | Stefan Weil | $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") |
25 | 17759187 | aliguori | |
26 | fa394727 | Peter Hjalmarsson | LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS)," LINK $(TARGET_DIR)$@") |
27 | 3aa892d7 | aliguori | |
28 | 3aa892d7 | aliguori | %$(EXESUF): %.o |
29 | 0bfe3ca5 | Anthony Liguori | $(call LINK,$^) |
30 | 4f188f88 | aliguori | |
31 | 93a0dba7 | aliguori | %.a: |
32 | 28c699a2 | aliguori | $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@") |
33 | 93a0dba7 | aliguori | |
34 | 28c699a2 | aliguori | quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1)) |
35 | 70071e17 | Juan Quintela | |
36 | 70071e17 | Juan Quintela | # cc-option |
37 | 8a2e6ab5 | Juan Quintela | # Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) |
38 | 70071e17 | Juan Quintela | |
39 | fc3baad7 | Thomas Monjalon | cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \ |
40 | fc3baad7 | Thomas Monjalon | >/dev/null 2>&1 && echo OK), $2, $3) |
41 | 1215c6e7 | Juan Quintela | |
42 | 1215c6e7 | Juan Quintela | # Generate timestamp files for .h include files |
43 | 1215c6e7 | Juan Quintela | |
44 | 1215c6e7 | Juan Quintela | %.h: %.h-timestamp |
45 | 1215c6e7 | Juan Quintela | @test -f $@ || cp $< $@ |
46 | 1215c6e7 | Juan Quintela | |
47 | 1215c6e7 | Juan Quintela | %.h-timestamp: %.mak |
48 | 3e65aaf5 | malc | $(call quiet-command, sh $(SRC_PATH)/create_config < $< > $@, " GEN $*.h") |
49 | 1215c6e7 | Juan Quintela | @cmp $@ $*.h >/dev/null 2>&1 || cp $@ $*.h |