#
# LPC modules Makefile
#
# Builds a bunch of .so modules for corresponding LPC files
# (LPC files should be compiled too really)
#
# Requires "gnumake"
#
# $Id: Makefile,v 1.12 2012/06/10 13:06:37 dredd Exp $
#
# $Source: /cvsroot/swlpc/swlpc/modules/Makefile,v $
# $Revision: 1.12 $
# $Date: 2012/06/10 13:06:37 $
# $State: Exp $
#
# Author: Geoff Wong
# Copyright (C) 1996, 1997 Geoff Wong
# geoff@cs.rmit.edu.au
#
# This Makefile messes up dependency checking (-MM) because
# it's looking for depencies on obj/<sys>/<file>.o instead of <file.o>
# which is how the dependencies are given in .depend
#
include ../swlpc.mk
# Target Name
TARGET=dummy
MUDLIB=../mudlib
#
# Some operating system dependent trickery
#
OBJPATH=.
VPATH=$(OBJPATH)
#
# Compiler Stuff
#
INCLUDE=-I../lpvm -I/usr/include/x86_64-linux-gnu
#
# The modules source
#
# crypt.c \
#
SRC = \
crypt.c \
math.c \
misc.c \
string.c \
os.c \
regexp.c \
socket.c \
network.c \
disass.c \
ed.c
# mysql.c \
#
# Define the object code
#
OBJ := $(SRC:%.c=$(OBJPATH)/%.o)
SOBJ := $(SRC:%.c=$(OBJPATH)/%.so)
#
# Find local headers
#
HDRS := $(shell echo *.h)
$(OBJPATH)/%.o: %.c
$(CC) $(PROF) -c $(CFLAGS) $(DEFS) $(INCLUDE) $< -o $@
$(OBJPATH)/crypt.so: crypt.o
$(CC) $(CFLAGS) -rdynamic -shared $(LDOPTS) -o $@ $< $(LIBS) -lssl
#$(OBJPATH)/%.so: %.o
# $(CC) $(CFLAGS) -rdynamic -shared $(LDOPTS) -o $@ $< $(LIBS) -lssl -lcrypto -lm
$(OBJPATH)/%.so: %.o
$(CC) $(CFLAGS) -shared $(LDOPTS) -o $@ $< $(LIBS) -llpvm -lm -lssl -lcrypto
first: .depend $(SOBJ)
$(MAKE) all
all: $(TARGET)
$(TARGET): $(SOBJ)
-echo Modules Built
install:
-cp *.so $(MUDLIB)/modules
-cp *.lpc $(MUDLIB)/modules
-cp crypt.so $(MUDLIB)/secure
-cp crypt.lpc $(MUDLIB)/secure
tags: $(SRC)
ctags $(SRC)
lint: $(SRC)
tlint $(SRC) > LINT
clean:
-rm -f $(SOBJ) $(OBJ) core
veryclean: clean
-rm -f $(TARGET) tags
# Depend stuff below (do not change!)
xdepend: $(SRC) $(HDRS)
$(CC) -MM $(DEFS) $(SRC) $(INCLUDE) > .depend
.PHONY:
-include .depend