[go: up one dir, main page]

Menu

[897c37]: / lpc / Makefile  Maximize  Restore  History

Download this file

137 lines (102 with data), 2.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#
# LPVM Makefile
#
# LPC Virtual Machine
#
# Requires "gnumake"
#
# $Id: Makefile,v 1.7 2004/06/15 13:36:12 dredd Exp $
#
# $Source: /cvsroot/swlpc/swlpc/lpc/Makefile,v $
# $Revision: 1.7 $
# $Date: 2004/06/15 13:36:12 $
# $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
include ../vsn.mk
# Target Name
TARGET=lpc.so
STARGET=lpc.a
TARGET2=mud.so
STARGET2=mud.a
#
# Some operating system dependent trickery
#
OBJPATH=.
VPATH=$(OBJPATH)
#
# Compiler Stuff
# NB: should really be determined by configure
#
#YACC=byacc
YFLAGS=-v -d
#
# The compiler source code
#
BASE = \
build.c \
lexical.c \
lexer.c \
compile.c \
yyerror.c
SRC = $(BASE) \
lang.c
MSRC = $(BASE) \
mud.c
#
# Define the object code
#
OBJ := $(SRC:%.c=$(OBJPATH)/%.o)
MOBJ := $(MSRC:%.c=$(OBJPATH)/%.o)
#
# Find local headers
#
HDRS := $(shell echo *.h)
$(OBJPATH)/%.o: %.c
$(CC) $(PROF) -c $(CFLAGS) $(DEFS) $(INCLUDE) $< -o $@
all: sdepend $(TARGET) $(TARGET2)
static: sdepend $(STARGET) $(STARGET2)
$(TARGET): $(OBJ)
-mv ../lib/lib$(TARGET).$(VERSION) ../lib/lib$(TARGET).$(VERSION)~
$(CC) $(CFLAGS) -shared $(LDOPTS) -o ../lib/lib$(TARGET).$(VERSION) $(OBJ) $(LIBS)
-rm ../lib/lib$(TARGET)
-ln -s ../lib/lib$(TARGET).$(VERSION) ../lib/lib$(TARGET)
$(STARGET): $(OBJ)
-mv ../lib/lib$(STARGET).$(VERSION) ../lib/lib$(STARGET).$(VERSION)~
$(AR) cr ../lib/lib$(STARGET).$(VERSION) $(OBJ)
-rm ../lib/lib$(STARGET)
-ln -s ../lib/lib$(STARGET).$(VERSION) ../lib/lib$(STARGET)
$(TARGET2): $(MOBJ)
-mv ../lib/lib$(TARGET2).$(VERSION) ../lib/lib$(TARGET2).$(VERSION)~
$(CC) $(CFLAGS) -shared $(LDOPTS) -o ../lib/lib$(TARGET2).$(VERSION) $(MOBJ)
-rm ../lib/lib$(TARGET2)
-ln -s ../lib/lib$(TARGET2).$(VERSION) ../lib/lib$(TARGET2)
$(STARGET2): $(MOBJ)
-mv ../lib/lib$(STARGET2).$(VERSION) ../lib/lib$(STARGET2).$(VERSION)~
$(AR) cr ../lib/lib$(STARGET2).$(VERSION) $(MOBJ)
-rm ../lib/lib$(STARGET2)
-ln -s ../lib/lib$(STARGET2).$(VERSION) ../lib/lib$(STARGET2)
tags: $(SRC)
ctags $(SRC)
lint: $(SRC) $(MSRC)
tlint $(SRC) $(MSRC) > LINT
clean:
-rm -f $(OBJ) $(MOBJ) core y.output
veryclean: clean
-rm -f $(TARGET) $(TARGET2) tags lang.c
# Depend stuff below (do not change!)
sdepend: $(SRC) $(MSRC) $(HDRS)
$(CC) -MM $(DEFS) $(SRC) $(MSRC) $(INCLUDE) > .depend
.PHONY:
-include .depend
%.c: %.y
$(YACC) $(YFLAGS) $<
mv y.tab.c $@