2004-02-16 21:25:11 +00:00
|
|
|
### HEADER HERE
|
|
|
|
|
2019-09-17 12:07:51 +00:00
|
|
|
OS=$(shell uname -s)
|
2004-02-16 21:25:11 +00:00
|
|
|
CC=gcc
|
2019-09-16 15:01:44 +00:00
|
|
|
CFLAGS=-ggdb -Wall -O2
|
2004-02-16 21:25:11 +00:00
|
|
|
#-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
|
|
|
|
|
2019-09-17 12:07:51 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2004-02-16 21:25:11 +00:00
|
|
|
all: build
|
|
|
|
|
|
|
|
build : $(OFILES)
|
2019-09-17 12:45:30 +00:00
|
|
|
@echo -e "Creating library..."
|
|
|
|
@ar rc $(DESTFILE) $(OFILES)
|
|
|
|
@ranlib $(DESTFILE)
|
2004-02-16 21:25:11 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo -e "Cleaning..."
|
|
|
|
@rm -f *.a
|
|
|
|
@rm -f *.o
|
|
|
|
|
|
|
|
%.o : %.c
|
2019-09-17 12:45:30 +00:00
|
|
|
@echo -e "$(CC)\t$@"
|
|
|
|
@$(CC) $(CFLAGS) -c $< $(INCLUDES) $(LIBINC) $(LIBS) $(DEFINES) -o $*.o
|
2019-09-17 12:46:44 +00:00
|
|
|
|
|
|
|
protos: $(CFILES)
|
2019-09-17 12:49:00 +00:00
|
|
|
@rm -f proto.h
|
|
|
|
@touch proto.h
|
2019-09-17 12:46:44 +00:00
|
|
|
@( echo -e "#ifndef _NZG_PROTO"; \
|
|
|
|
echo -e "#define _NZG_PROTO 1\n"; \
|
|
|
|
cproto *.c ; \
|
2019-09-17 12:49:00 +00:00
|
|
|
echo -e "\n#endif") > proto.t
|
|
|
|
@mv proto.t proto.h
|
2019-09-17 12:46:44 +00:00
|
|
|
|
|
|
|
|
2019-09-17 12:07:51 +00:00
|
|
|
edit:
|
|
|
|
gvim *.c *.h
|