Skip to content

Commit

Permalink
build: use user supplied CC and CFLAGS
Browse files Browse the repository at this point in the history
Don't try to be smart and add CROSS_COMPILE, most bulid systems will
to that already. As for CFLAGS, let the ringbearer, ehm user, decide.
  • Loading branch information
wkz committed Feb 1, 2016
1 parent e32d53e commit fb4d2e9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@
# Top directory for building complete system, fall back to this directory
ROOTDIR ?= $(shell pwd)

VERSION = 1.0-beta1
VERSION = 1-beta1
NAME = phytool
PKG = $(NAME)-$(VERSION)
ARCHIVE = $(PKG).tar.xz
APPLETS = mv6tool

PREFIX ?= /usr/local/
CFLAGS ?= -Wall -Wextra -Werror
LDLIBS =
CFLAGS = -W -Wall -Wextra
CFLAGS += -g

objs = $(patsubst %.c, %.o, $(wildcard *.c))
hdrs = $(wildcard *.h)

%.o: %.c $(hdrs) Makefile
@printf " CC $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
@$(CROSS_COMPILE)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c $< -o $@
@$(CC) $(CFLAGS) -c $< -o $@

phytool: $(objs)
@printf " CC $(subst $(ROOTDIR)/,,$(shell pwd)/$@)\n"
@$(CROSS_COMPILE)$(CC) $(LDLIBS) -o $@ $^
@$(CC) $(LDLIBS) -o $@ $^

all: phytool

Expand Down

0 comments on commit fb4d2e9

Please sign in to comment.