# -*- Makefile -*- # # This is a make+ file. Make+ is a set of scripts which enhance GNU # make and let you build RPMs, and other package types with just one # control file. To build this package you will need to download make+ # from this site: http://www.annexia.org/freeware/makeplus/ PACKAGE := dlife VERSION_MAJOR := 1 VERSION_MINOR := 1.0 VERSION := $(VERSION_MAJOR).$(VERSION_MINOR) SUMMARY := Distributed artificial life COPYRIGHT := GPL AUTHOR := Richard W.M. Jones define DESCRIPTION Distributed Artificial Life is a package for joining your computer to a network of computers running a large artificial life simulation. endef RPM_REQUIRES := perl-libwww-perl, perl >= 5.004, vixie-cron, SysVinit RPM_GROUP := Applications/Internet spooldir = $(localstatedir)/spool/dlife confdir = $(sysconfdir)/dlife crondir = $(sysconfdir)/cron.d rcdir = $(sysconfdir)/init.d CFLAGS += -Wall -Werror -g -O2 \ -DCONFDIR=\"$(confdir)\" \ -DSPOOLDIR=\"$(spooldir)\" #LIBS += ifdef ENABLE_CHECK CFLAGS += -DCHECK=1 endif ifdef ENABLE_PROFILE CFLAGS += -pg endif DOCS := $(srcdir)/AUTHORS $(srcdir)/INSTALL $(srcdir)/README \ $(srcdir)/archproc.gif $(srcdir)/archproc.fig \ $(srcdir)/archref.html $(srcdir)/index.html \ $(srcdir)/machineref.html OBJS := cell.o crc.o exec.o image.o load.o main.o random.o soup.o state.o all: build configure: $(MP_CONFIGURE_START) $(MP_CHECK_HEADERS) assert.h dirent.h errno.h fcntl.h grp.h pwd.h \ signal.h stddef.h stdint.h string.h sys/param.h sys/types.h \ syslog.h time.h unistd.h $(MP_CHECK_FUNCS) closedir getpwnam getuid initgroups nice opendir \ openlog readdir setgid setuid syslog ifndef DISABLE_USER_CHECK # $(MP_CHECK_USER_GROUP) dlife dlife endif $(MP_CONFIGURE_END) build: dlife_soup dlife_soup: $(OBJS) $(CC) $(CFLAGS) $^ $(LIBS) -o $@ test: install: install -d $(DESTDIR)$(bindir) install -d $(DESTDIR)$(docdir) install -d $(DESTDIR)$(spooldir) install -d $(DESTDIR)$(spooldir)/incoming install -d $(DESTDIR)$(spooldir)/outgoing install -d $(DESTDIR)$(spooldir)/saved install -d $(DESTDIR)$(spooldir)/store install -d $(DESTDIR)$(confdir) install -d $(DESTDIR)$(crondir) install -d $(DESTDIR)$(rcdir) install -m 0755 dlife_soup $(srcdir)/dlife_client.pl \ $(srcdir)/dlife_server.pl $(DESTDIR)$(bindir) install -m 0644 $(DOCS) $(DESTDIR)$(docdir) install -m 0644 god.dlo $(DESTDIR)$(spooldir) install -m 0644 $(srcdir)/client.conf $(srcdir)/soup.conf \ $(DESTDIR)$(confdir) install -m 0644 $(srcdir)/dlife_client.cron $(DESTDIR)$(crondir) install -m 0644 $(srcdir)/dlife.rc $(DESTDIR)$(rcdir) chown -R dlife.dlife $(DESTDIR)$(spooldir) ||: define WEBSITE XXX PUT YOUR WEBSITE HERE. IF YOU DON\'T WANT TO MANAGE A WEBSITE WITH XXX MAKE+ THEN JUST DELETE THIS SECTION AND THE upload_website RULE. endef upload_website: scp $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)-1.*.rpm \ $(PACKAGE)-$(VERSION).bin.tar.gz \ you@yourmachine.example.com:/var/www/html/$(PACKAGE)/files scp index.html you@yourmachine.example.com:/var/www/html/$(PACKAGE)/ .PHONY: build configure test upload_website