Skip to content

Commit

Permalink
Improve Makefile further
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpas committed Jan 17, 2018
1 parent c4eea48 commit 8fb3721
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ IMG = $(BIN)/main.img

all: $(IMG)

$(IMG): $(ELF)
@echo " GRUB $<"
@cp '$<' '$(BOOT)'
@$(GRUB) -o '$@' $(GRUBFLAGS)

$(ELF): \
$(patsubst %.c, %.o, $(wildcard $(SRC)/*.c)) \
$(patsubst %.asm, %.o, $(wildcard $(SRC)/*.asm))
@echo " LINK $<"
@$(LINK) -o '$(ELF)' $(LINKFLAGS) $^
@mkdir -p $(BIN)
@echo " LINK $@"
@$(LINK) -o $(ELF) $(LINKFLAGS) $^

$(IMG): $(ELF)
@echo " GRUB $@"
@cp '$<' '$(BOOT)'
@$(GRUB) -o $@ $(GRUBFLAGS)

$(SRC)/%.o: $(SRC)/%.c
@mkdir -p $(BIN)
@echo " CC $<"
@$(CC) $(CFLAGS) -o '$@' -c '$<' $(CLIBS)

Expand Down

0 comments on commit 8fb3721

Please sign in to comment.