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.
38 lines
814 B
38 lines
814 B
SHELL := /bin/bash
|
|
|
|
# ============================================
|
|
# COMMANDS
|
|
|
|
CC = gcc -std=gnu99
|
|
RM = rm -f
|
|
CFLAGS_DEBUG=-O2 -ggdb3 -Wall -Werror -pedantic -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -grecord-gcc-switches -Werror=implicit-function-declaration -I.
|
|
CFLAGS=-O2 -Wall -Werror -pedantic -I.
|
|
|
|
OBJ=test_sample.o test_sample_functions.o
|
|
DEPS=test_sample_functions.h
|
|
|
|
# ==========================================
|
|
# TARGETS
|
|
|
|
EXECUTABLES = test_sample.out
|
|
|
|
.PHONY: all clean
|
|
|
|
all: $(EXECUTABLES)
|
|
|
|
# ==========================================
|
|
# DEPENDENCIES (HEADERS)
|
|
|
|
%.o: %.c $(DEPS)
|
|
$(CC) -c -o $@ $< $(CFLAGS)
|
|
|
|
.PRECIOUS: $(EXECUTABLES) $(OBJ)
|
|
|
|
# ==========================================
|
|
# EXECUTABLE (MAIN)
|
|
|
|
$(EXECUTABLES): $(OBJ)
|
|
$(CC) -o $@ $^ $(CFLAGS)
|
|
|
|
clean:
|
|
$(RM) *.o *~ $(EXECUTABLES)
|
|
|