diff options
author | Thordur Bjornsson <thorduri@secnorth.net> | 2012-11-04 17:16:14 +0100 |
---|---|---|
committer | Thordur Bjornsson <thorduri@secnorth.net> | 2012-11-04 17:16:14 +0100 |
commit | 65780fdfff8cb81e99b7b5ba8d69391d81c97aba (patch) | |
tree | e0c5c97743638136ff344b08136fd0156c154221 /Makefile | |
download | ministat-65780fdfff8cb81e99b7b5ba8d69391d81c97aba.tar.gz ministat-65780fdfff8cb81e99b7b5ba8d69391d81c97aba.tar.xz ministat-65780fdfff8cb81e99b7b5ba8d69391d81c97aba.zip |
initial import
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..25d8394 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +CC ?= clang +INSTALLPATH ?= /usr/bin + +CFLAGS += -Wall -Werror +LDFLAGS += -lm + +BIN = ministat +SRC = $(BIN).c + +# No user serviceable parts below this line. +OBJS = $(addprefix $(OBJ), $(SRC:.c=.o)) +DEPS = $(addsuffix .depend, $(OBJS)) +OBJ = obj + +all: obj $(OBJ)/$(BIN) + +obj: + -mkdir obj + +$(OBJ)$/(BIN): $(OBJS) + $(CC) -o $@ $^ ${LDFLAGS} + + +$(OBJ)/%.o: %.c + @echo "Generating $@.depend" + @$(CC) $(CFLAGS) -MM $< | \ + sed 's,$*\.o[ :]*,$@ $@.depend : ,g' >> $@.depend + $(CC) $(CFLAGS) -o $@ -c $< + +depend: + @echo "Dependencies are automatically generated." + +install: + install -m 0755 $(OBJ)/$(BIN) $(INSTALLPATH) + +clean: + -rm -rf $(BIN) obj *.core + +.PHONY: all depend install clean + +-include $(DEPS) |