Better makefile object build recipe
This commit is contained in:
parent
c41f3b0d5f
commit
9aaca16baf
|
@ -10,6 +10,9 @@ else
|
|||
ARMGCC_ROOT := ${shell dirname ${ARMGCC_BIN}}/..
|
||||
endif
|
||||
|
||||
# Search for source files that are not in this directory
|
||||
VPATH = ../common/
|
||||
|
||||
OBJECTS = main.o system.o startup.o syscalls.o
|
||||
|
||||
NAME = lab
|
||||
|
@ -47,7 +50,7 @@ LFLAGS = -Wl,-T,../config.lds \
|
|||
all: $(NAME).out
|
||||
@echo "SUCCESS: Compilation completed successfully."
|
||||
|
||||
main.o: main.c
|
||||
%.o: %.c
|
||||
@$(CC) $(CFLAGS) -g $< -c -o $@
|
||||
|
||||
system.o: ../system.c
|
||||
|
|
|
@ -10,6 +10,9 @@ else
|
|||
ARMGCC_ROOT := ${shell dirname ${ARMGCC_BIN}}/..
|
||||
endif
|
||||
|
||||
# Search for source files that are not in this directory
|
||||
VPATH = ../common/
|
||||
|
||||
OBJECTS = main.o bump.o delay.o clock.o system.o startup.o syscalls.o
|
||||
|
||||
NAME = lab
|
||||
|
@ -47,13 +50,7 @@ LFLAGS = -Wl,-T,../config.lds \
|
|||
all: $(NAME).out
|
||||
@echo "SUCCESS: Compilation completed successfully."
|
||||
|
||||
main.o: main.c
|
||||
@$(CC) $(CFLAGS) -g $< -c -o $@
|
||||
|
||||
bump.o: ../common/bump.c
|
||||
@$(CC) $(CFLAGS) -g $< -c -o $@
|
||||
|
||||
delay.o: ../common/delay.c
|
||||
%.o: %.c
|
||||
@$(CC) $(CFLAGS) -g $< -c -o $@
|
||||
|
||||
clock.o: ../common/clock.c
|
||||
|
|
|
@ -10,7 +10,10 @@ else
|
|||
ARMGCC_ROOT := ${shell dirname ${ARMGCC_BIN}}/..
|
||||
endif
|
||||
|
||||
OBJECTS = main.o bump.o delay.o clock.o reflectance.o cpu.o system.o startup.o syscalls.o
|
||||
# Search for source files that are not in this directory
|
||||
VPATH = ../common/
|
||||
|
||||
OBJECTS = main.o bump.o delay.o reflectance.o clock.o cpu.o system.o startup.o syscalls.o
|
||||
|
||||
NAME = lab
|
||||
|
||||
|
@ -47,21 +50,12 @@ LFLAGS = -Wl,-T,../config.lds \
|
|||
all: $(NAME).out
|
||||
@echo "SUCCESS: Compilation completed successfully."
|
||||
|
||||
main.o: main.c
|
||||
@$(CC) $(CFLAGS) -g $< -c -o $@
|
||||
|
||||
bump.o: ../common/bump.c
|
||||
@$(CC) $(CFLAGS) -g $< -c -o $@
|
||||
|
||||
delay.o: ../common/delay.c
|
||||
%.o: %.c
|
||||
@$(CC) $(CFLAGS) -g $< -c -o $@
|
||||
|
||||
clock.o: ../common/clock.c
|
||||
@$(CC) $(CFLAGS) $< -c -o $@
|
||||
|
||||
reflectance.o: ../common/reflectance.c
|
||||
@$(CC) $(CFLAGS) -g $< -c -o $@
|
||||
|
||||
cpu.o: ../common/cpu.c
|
||||
@$(CC) $(CFLAGS) $< -c -o $@
|
||||
|
||||
|
|
Loading…
Reference in New Issue