Makefile.in 1.7 KB
Newer Older
1 2
# Makefile.in : Makefile structure for mini-SAP-server
# $Id: Makefile.in,v 1.1 2003/08/10 12:44:18 zorglub Exp $
3 4 5 6

FILES_O=$(FILES:%=%.o)

GPP= g++ $(CFLAGS)
Alexis de Lattre's avatar
Alexis de Lattre committed
7

8 9
all: default

10
default: sapserver
11

12 13
# Main target. Build .o files from every.cpp files and build the final
# executable
14 15
sapserver: $(FILES_O)
	$(GPP) $(LDFLAGS) -o ${EXECNAME} $(FILES_O)
16 17 18 19

# Target that builds a .o from each .cpp
$(FILES_O): %.o: %.cpp %.h
	$(GPP) -c $*.cpp
20

21
# Delete the .o files and the executable
Alexis de Lattre's avatar
Alexis de Lattre committed
22
clean:
23
	rm -f $(FILES_O)
24 25 26 27 28
	rm -f ${EXECNAME}

# Also delete the Makefile (configure needed)
allclean: clean
	rm -f Makefile
29

30
# Cleans and remove the dists
31
distclean: clean
Alexis de Lattre's avatar
Alexis de Lattre committed
32 33 34
	rm -f miniSAPserver-${VERSION}.tar.bz2
	rm -f miniSAPserver-${VERSION}.tar.gz

35 36 37 38 39 40 41 42 43 44 45
# Install in the prefix
install:
	install -d ${EXECDIR}
	install -d ${MANDIR}
	install -d ${CONFDIR}

	install -m 755 ${EXECNAME} ${EXECDIR}
	install -m 644 ${MANPAGE}  ${MANDIR}
	install -m 644 ${CONFFILE} ${CONFDIR}


46
# Makes the dists.
Alexis de Lattre's avatar
Alexis de Lattre committed
47 48 49 50 51 52 53 54
dist:
	-# Check that tmp isn't in the way
	@if test -e tmp; then \
		echo "Error: please remove ./tmp, it is in the way"; false; \
	else \
	echo "Starting dist's build."; mkdir tmp; \
	fi
	mkdir tmp/miniSAPserver/
55 56 57 58
	# Rebuild the configure script
	autoconf
	# Copy the Makefile.in & configure script
	cp Makefile.in configure tmp/miniSAPserver/
Alexis de Lattre's avatar
Alexis de Lattre committed
59 60 61 62
	# Copy the configration file
	cp sap.cfg tmp/miniSAPserver/
	# Copy all headers and source code files
	cp *.cpp *.h tmp/miniSAPserver/
63
	# Copy AUTHORS and COPYING
Alexis de Lattre's avatar
Alexis de Lattre committed
64 65 66 67 68 69 70 71
	cp AUTHORS COPYING tmp/miniSAPserver/
	# Build archives
	F=miniSAPserver-${VERSION}; \
		mv tmp/miniSAPserver tmp/$$F; (cd tmp ; tar cf $$F.tar $$F); \
		bzip2 -f -9 < tmp/$$F.tar > $$F.tar.bz2; \
		gzip -f -9 tmp/$$F.tar ; mv tmp/$$F.tar.gz .
	# Clean up
	rm -Rf tmp