Last change
on this file since 172 was
172,
checked in by leroy, 12 years ago
|
Making that Makefile self-compiling in hello app
|
File size:
501 bytes
|
Line | |
---|
1 | APP_NAME=hello |
---|
2 | |
---|
3 | USE+= stdio.o |
---|
4 | |
---|
5 | USES=$(patsubst %,$(BUILD_PATH)/$(LIB_NAME)/%,$(USE)) |
---|
6 | |
---|
7 | OBJS = main.o |
---|
8 | |
---|
9 | TRASH ?= /dev/null |
---|
10 | |
---|
11 | all: $(APP_NAME).elf |
---|
12 | |
---|
13 | BIN_NAME_PATH=$(ELF_PATH)$(APP_NAME).elf |
---|
14 | |
---|
15 | $(APP_NAME).elf: $(OBJS) $(APP_NAME).ld |
---|
16 | $(LD) -o $(BIN_NAME_PATH) -T $(APP_NAME).ld $(OBJS) $(USES) |
---|
17 | $(DU) -D $(BIN_NAME_PATH) > $@.txt |
---|
18 | |
---|
19 | %.o: %.c |
---|
20 | $(CC) $(INCLUDE) $(CFLAGS) $($*.o_CFLAGS) -c -o $@ $< |
---|
21 | $(DU) -D $@ > $@.txt |
---|
22 | |
---|
23 | |
---|
24 | clean: |
---|
25 | rm -f *.o *.elf *.txt core *~ 2>$(TRASH) |
---|
26 | rm -f $(BIN_NAME_PATH) 2>$(TRASH) |
---|
Note: See
TracBrowser
for help on using the repository browser.