From 49a256b373328df65e61f2d6b610682d6d06903f Mon Sep 17 00:00:00 2001 From: Siegfried Kienzle Date: Sat, 22 Apr 2017 17:35:50 +0200 Subject: [PATCH] write an Makefile for motor.c --- project/Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 project/Makefile diff --git a/project/Makefile b/project/Makefile new file mode 100755 index 0000000..e36559e --- /dev/null +++ b/project/Makefile @@ -0,0 +1,23 @@ +# Makefile +CC=gcc +CFLAGS = -W -Wall -pedantic -std=gnu99 -c +LDFLAGS = -static +RM = rm -f + +TARGET = motor +OBJECTS = motor.o +SOURCES = $(TARGET).c $(OBJECTS:.o=.c) + +.PHONY: all clean + +all: $(TARGET) + +clean: + $(RM) $(TARGET) $(OBJECTS) + +$(OBJECTS): $(SOURCES) + $(CC) $(CFLAGS) $< + +$(TARGET): $(OBJECTS) + $(CC) $(LDFLAGS) -o $@ $^ + $(RM) $(OBJECTS)