64 lines
666 B
Makefile
64 lines
666 B
Makefile
#
|
|
# This Makefile is compatible with GNU Make (gmake) and should work on FreeBSD
|
|
#
|
|
|
|
#
|
|
# Your operating system
|
|
#
|
|
|
|
OS = FREEBSD
|
|
|
|
#
|
|
# Directories
|
|
#
|
|
|
|
INCDIR = inc
|
|
LIBDIR = lib
|
|
OBJDIR = obj
|
|
SRCDIR = src
|
|
|
|
#
|
|
# Programs
|
|
#
|
|
|
|
AR = ar
|
|
CC = gcc
|
|
|
|
#
|
|
# Flags
|
|
#
|
|
|
|
CFLAGS = -g -O2 -pipe -std=c99 -Wall
|
|
CFLAGS += -DOS=$(OS)
|
|
CFLAGS += -I$(INCDIR)
|
|
|
|
#
|
|
# Object files
|
|
#
|
|
|
|
OBJS = $(OBJDIR)/sam.o
|
|
|
|
#
|
|
# Build rules
|
|
#
|
|
|
|
all: depend libsam
|
|
|
|
depend:
|
|
$(CC) $(CFLAGS) -MM $(SRCDIR)/*.c > .depend
|
|
|
|
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
libsam: $(OBJS)
|
|
$(AR) rcs $(LIBDIR)/libsam.a $(OBJS)
|
|
|
|
#
|
|
# Cleanup rules
|
|
#
|
|
|
|
clean:
|
|
-rm -f $(LIBDIR)/libsam.a $(OBJDIR)/* .depend
|
|
|
|
tidy: clean
|