34 lines
788 B
Makefile
34 lines
788 B
Makefile
# Source, Executable, Includes, Library Defines
|
|
INCL =
|
|
SRC = main.c
|
|
OBJ = $(SRC:.c=.o)
|
|
LIBS =
|
|
EXE = sleep
|
|
|
|
# Compiler, Linker Defines
|
|
CC = /usr/bin/gcc
|
|
CFLAGS = -ansi -pedantic -Wall -O2
|
|
LIBPATH = -L.
|
|
LDFLAGS = -o $(EXE) $(LIBPATH) $(LIBS)
|
|
CFDEBUG = -ansi -pedantic -Wall -g -DDEBUG $(LDFLAGS)
|
|
RM = /bin/rm -f
|
|
|
|
# Compile and Assemble C Source Files into Object Files
|
|
%.o: %.c
|
|
$(CC) -c $(CFLAGS) $*.c
|
|
|
|
# Link all Object Files with external Libraries into Binaries
|
|
$(EXE): $(OBJ)
|
|
$(CC) $(LDFLAGS) $(OBJ)
|
|
|
|
# Objects depend on these Libraries
|
|
$(OBJ): $(INCL)
|
|
|
|
# Create a gdb/dbx Capable Executable with DEBUG flags turned on
|
|
debug:
|
|
$(CC) $(CFDEBUG) $(SRC)
|
|
|
|
# Clean Up Objects, Exectuables, Dumps out of source directory
|
|
clean:
|
|
$(RM) $(OBJ) $(EXE) core a.out *.csv
|