Last active
December 18, 2019 00:55
-
-
Save nickylimjj/7c140d3d5b0d3284226c4ee12a1c322a to your computer and use it in GitHub Desktop.
Sample makefile from .s -> bin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AS := as | |
LD := ld | |
SRC := $(wildcard *.s) | |
OBJ := $(patsubst %.s, %.o, $(SRC)) | |
BIN := $(patsubst %.o, %, $(OBJ)) | |
.PHONY: all | |
all: $(BIN) | |
$(BIN): $(OBJ) | |
@echo linking... | |
$(LD) -o $@ $< | |
$(OBJ) : $(SRC) | |
@echo assembling... | |
$(AS) -o $@ $< | |
.PHONY: clean | |
clean: | |
rm $(BIN) $(OBJ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment