Fix cow Makefile to install to /usr/local

This makes it safe to build on multiple machines
of different architectures.
This commit is contained in:
Michael Spang 2007-07-16 16:58:43 -04:00
parent 0b91f80776
commit aca12e3b5b
3 changed files with 14 additions and 3 deletions

4
cow/.gitignore vendored
View File

@ -1,2 +1,4 @@
*.o
/cow
/i686
/x86_64
/alpha

View File

@ -1,10 +1,17 @@
MAIN = cow
ARCH=$(shell uname -m)
MAIN = $(ARCH)/cow
CFLAGS = -I/usr/include/libxml2 -DDEBUG -pedantic -ansi -Wall
LDFLAGS = $(CFLAGS) -lxml2 -lxslt
SOURCES = $(wildcard *.c)
OBJECTS = $(SOURCES:.c=.o)
OBJECTS = $(addprefix $(ARCH)/,$(SOURCES:.c=.o))
all: $(MAIN)
$(ARCH):
mkdir -p $(ARCH)
$(MAIN): $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(OBJECTS)
$(ARCH)/%.o: %.c $(ARCH)
$(CC) -c $(CFLAGS) -o $@ $<

2
cow/cow Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec "$(dirname $0)/$(uname -m)/$(basename $0)" "$@"