Commit 0052e05c authored by Stefan Tauner's avatar Stefan Tauner
Browse files

makefile: allow compiler to be set and use gcc only as default

parent b773f28e
......@@ -38,7 +38,9 @@ ifeq ($(filter $(MAKECMDGOALS),clean help),)
endif
endif
### Recommended gcc flags
CC ?= gcc
### Recommended compiler flags
CFLAGS = -std=gnu99
CFLAGS += -Os
CFLAGS += -pedantic
......@@ -60,10 +62,10 @@ CFLAGS += -Wunreachable-code
### all ###
all: $(OBJS) $(CURDIR)/$(TARGET).elf
$(CURDIR)/$(TARGET).elf: $(OBJS) | $(BUILDDIR)
gcc $(CFLAGS) $(INCS) -o $(CURDIR)/$(TARGET).elf $(OBJS)
$(CC) $(CFLAGS) $(INCS) -o $(CURDIR)/$(TARGET).elf $(OBJS)
$(BUILDDIR)/%.o: $(SRCDIR)/%.c | $(BUILDDIR)
gcc -c $(CFLAGS) $(INCS) $< -o $@
$(CC) -c $(CFLAGS) $(INCS) $< -o $@
$(BUILDDIR):
mkdir -p $(BUILDDIR)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment