You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
609 B
37 lines
609 B
7 years ago
|
SHELL := /bin/bash
|
||
|
|
||
|
# ============================================
|
||
|
# COMMANDS
|
||
|
|
||
|
CC = gcc
|
||
|
RM = rm -f
|
||
7 years ago
|
CFLAGS=-lm -O3 -Wall -I.
|
||
7 years ago
|
OBJ=serial.o serial_declarations.o
|
||
|
DEPS=serial_declarations.h
|
||
7 years ago
|
|
||
|
# ==========================================
|
||
|
# TARGETS
|
||
|
|
||
7 years ago
|
EXECUTABLES = serial
|
||
7 years ago
|
|
||
7 years ago
|
.PHONY: all clean
|
||
|
|
||
7 years ago
|
all: $(EXECUTABLES)
|
||
|
|
||
7 years ago
|
# ==========================================
|
||
|
# DEPENDENCIES (HEADERS)
|
||
|
|
||
|
%.o: %.c $(DEPS)
|
||
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||
|
|
||
|
.PRECIOUS: $(EXECUTABLES) $(OBJ)
|
||
|
|
||
|
# ==========================================
|
||
|
# EXECUTABLE (MAIN)
|
||
|
|
||
|
$(EXECUTABLES): $(OBJ)
|
||
|
$(CC) -o $@ $^ $(CFLAGS)
|
||
7 years ago
|
|
||
|
clean:
|
||
|
$(RM) *.o *~ $(EXECUTABLES)
|