l3.libnazgul/src/Makefile

48 lines
741 B
Makefile

### HEADER HERE
OS=$(shell uname -s)
CC=gcc
CFLAGS=-ggdb -Wall -O2
#-O2
#LIBS=-lrt
#-verbose
PRJNAME=Libnazgul
GDATE := $(shell date +"-%Y-%m-%d_r%H")
GFILENAME := ../$(PRJNAME)$(GDATE).tar.bz2
LOCALDIR = $(shell pwd)
BINDIR=../bin
CFILES := $(shell ls *.c)
OFILES := $(patsubst %.c,%.o,$(CFILES))
DESTFILE=libnazgul.a
DEFINES:=
ifeq "SunOS" "${OS}"
DEFINES:=-D_NZG_REALFILEID
endif
ifeq "HP-UX" "${OS}"
DEFINES:=-D_NZG_REALFILEID
endif
ifeq "Linux" "${OS}"
#DEFINES:=-D_NZG_REALFILEID
endif
all: build
build : $(OFILES)
ar rc $(DESTFILE) $(OFILES)
ranlib $(DESTFILE)
clean:
@echo -e "Cleaning..."
@rm -f *.a
@rm -f *.o
%.o : %.c
$(CC) $(CFLAGS) -c $< $(INCLUDES) $(LIBINC) $(LIBS) $(DEFINES) -o $*.o
edit:
gvim *.c *.h