1 | ARCH_FORMAT= armnommu
|
---|
2 |
|
---|
3 | ROMLIMIT= 20480
|
---|
4 | CHECKSIZE= { read d1; read d1 d2 d3 size d4; [ $$size -gt $(ROMLIMIT) ] &&\
|
---|
5 | { $(RM) $@; echo "ERROR: code size exceeds limit!"; exit 1; }; exit 0; }
|
---|
6 |
|
---|
7 | START= $(BIN)/start.o
|
---|
8 |
|
---|
9 | SRCS+= arch/armnommu/core/arm_timer.c
|
---|
10 | SRCS+= arch/armnommu/core/start.S
|
---|
11 | SRCS+= arch/armnommu/core/serial.c
|
---|
12 | SRCS+= arch/armnommu/core/mem.c
|
---|
13 | SRCS+= arch/armnommu/core/setjmp.S
|
---|
14 | SRCS+= arch/armnommu/drivers/net/p2001_eth.c
|
---|
15 |
|
---|
16 | # not greater than 100kB
|
---|
17 | ROMLIMIT:=1024000
|
---|
18 |
|
---|
19 | include $(BIN)/Roms
|
---|
20 |
|
---|
21 | ROMS= $(BIN)/p2001_eth.rom
|
---|
22 | IMGS= $(BIN)/p2001_eth.img
|
---|
23 |
|
---|
24 |
|
---|
25 | allfiles: $(ROMS)
|
---|
26 |
|
---|
27 | BOBJS+= $(BIN)/arm_timer.o
|
---|
28 | BOBJS+= $(BIN)/serial.o
|
---|
29 | BOBJS+= $(BIN)/mem.o
|
---|
30 | BOBJS+= $(BIN)/setjmp.o
|
---|
31 | BOBJS+= $(BIN)/lib1funcs.o
|
---|
32 |
|
---|
33 | # Utilities
|
---|
34 |
|
---|
35 | $(BIN)/nrv2b: util/nrv2b.c
|
---|
36 | $(HOST_CC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -DNDEBUG -DBITSIZE=32 -DENDIAN=0 -o $@ $<
|
---|
37 |
|
---|
38 | # Pattern Rules
|
---|
39 | # General for compiling/assembly source files
|
---|
40 | $(BIN)/%.o: arch/armnommu/core/%.c $(MAKEDEPS)
|
---|
41 | $(CC) $(CFLAGS) -o $@ -c $<
|
---|
42 |
|
---|
43 | $(BIN)/%.o: arch/armnommu/drivers/net/%.c $(MAKEDEPS)
|
---|
44 | $(CC) $(CFLAGS) -o $@ -c $<
|
---|
45 |
|
---|
46 | $(BIN)/%.S: arch/armnommu/core/%.c $(MAKEDEPS)
|
---|
47 | $(CC) $(CFLAGS) -S -o $@ -c $<
|
---|
48 |
|
---|
49 | $(BIN)/%.o: arch/armnommu/core/%.S $(MAKEDEPS)
|
---|
50 | $(CPP) $(CFLAGS) -D ASSEMBLY $< | $(AS) $(ASFLAGS) -o $@
|
---|
51 |
|
---|
52 | # general ruls for generating .img files
|
---|
53 | $(BIN)/%.tmp: $(BIN)/%.o $(START) $(BIN)/config.o arch/$(ARCH)/core/etherboot.lds $(LIBS) $(STDDEPS) $(MAKEDEPS)
|
---|
54 | $(LD) $(LDFLAGS) -T arch/$(ARCH)/core/etherboot.lds -o $@ $(START) $(BIN)/config.o $< $(LIBS)
|
---|
55 | @$(SIZE) $@ | $(CHECKSIZE)
|
---|
56 |
|
---|
57 | $(BIN)/%.img: $(BIN)/%.tmp $(MAKEDEPS)
|
---|
58 | $(OBJCOPY) -O binary $< $@
|
---|