-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
48 lines (33 loc) · 1.02 KB
/
Copy pathmakefile
File metadata and controls
48 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
ifeq (,$(CPU_TARGET))
CPU_TARGET=i686
endif
CC=gcc
CFLAGS=-c -g -DCPU$(CPU_TARGET)
SRC = bcc.c scope.c opstack.c function.c regalloc.c symtab.c token.c log.c \
cpu/generic/cpu_generic.c cpu/$(CPU_TARGET)/cpu_$(CPU_TARGET).c
HDR = cpu.h scope.h opstack.h function.h regalloc.h symtab.h token.h cpu.h log.h \
cpu/$(CPU_TARGET)/cpu_$(CPU_TARGET).h
LSRC = $(notdir $(SRC))
OBJECTS = $(LSRC:%.c=%.o)
bcc: cpuspec.h $(OBJECTS)
$(CC) -o bcc $(OBJECTS)
clean:
rm *.o cpuspec.h
cpuspec.h: cpu/$(CPU_TARGET)/cpu_$(CPU_TARGET).h
cp $< $@
%.o:%.c
$(CC) $(CFLAGS) -o $(notdir $@) $<
%.o:cpu/generic/%.c
$(CC) $(CFLAGS) -o $(notdir $@) $<
%.o:cpu/$(CPU_TARGET)/%.c
$(CC) $(CFLAGS) -o $(notdir $@) $<
bcc.o: bcc.c $(HDR)
scope.o: scope.c $(HDR)
opstack.o: opstack.c $(HDR)
function.o: function.c $(HDR)
regalloc.o: regalloc.c $(HDR)
symtab.o: symtab.c $(HDR)
token.o: token.c $(HDR)
log.o: log.c $(HDR)
cpu_generic.o: cpu/generic/cpu_generic.c $(HDR)
cpu_$(CPU_TARGET).o: cpu/$(CPU_TARGET)/cpu_$(CPU_TARGET).c $(HDR)