summaryrefslogtreecommitdiff
path: root/gnu/egcs/libobjc/Makefile.bsd-wrapper
blob: 4295b1cfc8fffa8af48bc846123be442984bfc49 (plain)
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
#	$OpenBSD: Makefile.bsd-wrapper,v 1.3 1999/09/24 08:25:14 espie Exp $

LIB=		objc

#CXXFLAGS+=	-fno-implicit-templates
#CPPFLAGS+=	-I$(.CURDIR) -I$(.CURDIR)/stl -I$(.CURDIR)/../libio -I$(IO_OBJDIR)
#LDADD+=		-lm

EGCS_DIR= $(.CURDIR)/..
.if defined(OBJMACHINE)
OBJDIR=	obj.${MACHINE}
.else
OBJDIR=	obj
.endif
EGCS_OBJDIR!=	if [ -d $(EGCS_DIR)/$(OBJDIR) ]; then \
			echo $(EGCS_DIR)/$(OBJDIR); \
		else \
			echo $(EGCS_DIR); \
		fi

CPPFLAGS+= -I. -I$(.CURDIR) -I$(.CURDIR)/objc  -I$(.CURDIR)/../gcc \
-I$(.CURDIR)/../gcc/config  -I$(EGCS_OBJDIR)/gcc -I$(.CURDIR)/../include \
-DIN_GCC

SRCS=archive.c class.c encoding.c gc.c hash.c init.c linking.m misc.c \
nil_method.c NXConstStr.m Object.m objects.c Protocol.m sarray.c  \
selector.c sendmsg.c thr.c thr-single.c

CLEANFILES= config.cache config.status config.log Makefile runtime-info.h
#CFLAGS+=-save-temps


includes:
	install -d -m 755 -o $(BINOWN) -g $(BINGRP) \
		$(DESTDIR)/usr/include/objc
	@-cd $(.CURDIR)/objc; for i in *.h; do \
		[ $$i = "runtime.h" ] || install -C -o $(BINOWN) -g $(BINGRP) -m $(NONBINMODE) \
				$$i $(DESTDIR)/usr/include/objc/$$i; \
	done
	

all: config.status

depend: 
	cd ${.CURDIR}/../gcc && make -f Makefile.bsd-wrapper config.status target_path

sendmsg.o sengmsg.po sendmsg.so: runtime-info.h

runtime-info.h:
		echo "" > tmp-runtime
		echo "/* This file is automatically generated */" > $@
		`$(CC) -print-prog-name=cc1obj` -print-objc-runtime-info tmp-runtime >> $@
		rm -f tmp-runtime

config.status: Makefile.in configure 
	cd $(EGCS_OBJDIR)/gcc && touch cc1obj
	PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
	INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
	r=$(EGCS_OBJDIR) \
	/bin/sh ${.CURDIR}/configure \
		--prefix=/usr --with-local-prefix=/usr ${CF} \
		&& touch config.status

.include <bsd.lib.mk>
COMPILE.m=${COMPILE.c} -fgnu-runtime

gc.o: gc.c
	@echo "${COMPILE.m} ${.IMPSRC} -o ${.TARGET}"
	@${COMPILE.m} ${.IMPSRC}  -o ${.TARGET}.o
	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
	@rm -f ${.TARGET}.o
	
gc.po: gc.c
	@echo "${COMPILE.m} -p ${.IMPSRC} -o ${.TARGET}"
	@${COMPILE.m} -p ${.IMPSRC} -o ${.TARGET}.o
	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
	@rm -f ${.TARGET}.o

gc.so: gc.c
	@echo "${COMPILE.m} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}"
	@${COMPILE.m} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o
	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
	@rm -f ${.TARGET}.o

.m.o:
	@echo "${COMPILE.m} ${.IMPSRC} -o ${.TARGET}"
	@${COMPILE.m} ${.IMPSRC}  -o ${.TARGET}.o
	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
	@rm -f ${.TARGET}.o

.m.po:
	@echo "${COMPILE.m} -p ${.IMPSRC} -o ${.TARGET}"
	@${COMPILE.m} -p ${.IMPSRC} -o ${.TARGET}.o
	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
	@rm -f ${.TARGET}.o

.m.so:
	@echo "${COMPILE.m} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}"
	@${COMPILE.m} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o
	@${LD} -x -r ${.TARGET}.o -o ${.TARGET}
	@rm -f ${.TARGET}.o