Created
November 15, 2010 21:30
-
-
Save intoverflow/700984 to your computer and use it in GitHub Desktop.
Makefile for Phreebird 1.02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: phreebird phreeload ldns_chase unbound_trace | |
VERSION=1.021 | |
INSTALLDIR=$(PWD)/dist | |
BIN=$(INSTALLDIR)/bin | |
LIB=$(INSTALLDIR)/lib | |
INCLUDE=$(INSTALLDIR)/include | |
CC=gcc -I"$(INCLUDE)" -O2 -g -DPB_VERSION="\"$(VERSION)\"" -L"$(LIB)" -L/usr/local/lib -Xlinker -R"$(LIB)" -Xlinker -R/usr/local/lib | |
TOKENS=./tokens | |
$(BIN): | |
mkdir -p $(BIN) | |
$(LIB): | |
mkdir -p $(LIB) | |
phreebird: $(BIN) token-ldns token-levent token-lghthash | |
$(CC) -o phreebird phreebird.c -lldns -lcrypto -levent -lghthash | |
cp phreebird $(BIN) | |
phreeload: $(BIN) $(LIB) token-lunbound | |
$(CC) -D_GNU_SOURCE -lunbound -lcrypto -ldl -Wall -shared -fPIC -o phreeload.so phreeload.c -I/usr/local/ssl/include | |
cp phreeload $(BIN) | |
cp phreeload.so $(LIB) | |
ldns_chase: $(BIN) token-ldns | |
$(CC) -o ldns_chase ldns_chase.c -lldns -lcrypto | |
cp ldns_chase $(BIN)/ldns_chase | |
unbound_trace: $(BIN) token-lunbound token-ldns | |
$(CC) -o unbound_trace unbound_trace.c -lunbound -lldns -lcrypto | |
cp unbound_trace $(BIN)/unbound_trace | |
package: | |
rm -rf phreebird_suite_$(VERSION) | |
mkdir phreebird_suite_$(VERSION) | |
cp -rvf Makefile depbuild.sh LICENCE README.txt CHANGELOG.txt HACKING.txt phreebird.c \ | |
phreeload.c phreeload ldns_chase.c unbound_trace.c patches INSTALL.txt deps phreebird_suite_$(VERSION) | |
tar czvf phreebird_suite_$(VERSION).tar.gz phreebird_suite_$(VERSION) | |
rm -rf phreebird_suite_$(VERSION) | |
phreebird_deps: token-ldns token-levent token-lghthash token-lunbound | |
token-lunbound: | |
@echo "Installing libunbound with prefix $(INSTALLDIR)" | |
cd deps ; tar -zxvf unbound-1.4.3_lite.tar.gz | |
cd deps/unbound-1.4.3 ; ./configure --prefix=$(INSTALLDIR) | |
make -C deps/unbound-1.4.3 all install | |
touch token-lunbound | |
token-lghthash: | |
@echo "Installing lghthash with prefix $(INSTALLDIR)" | |
cd deps ; tar -zxvf libghthash-0.6.2.tar.gz | |
cd deps/libghthash-0.6.2 ; ./configure --prefix=$(INSTALLDIR) | |
make -C deps/libghthash-0.6.2 all install | |
touch token-lghthash | |
token-levent: | |
@echo "Installing libevent with prefix $(INSTALLDIR)" | |
cd deps ; tar -zxvf libevent-2.0.1-alpha.tar.gz | |
cd deps/libevent-2.0.1-alpha ; ./configure --prefix=$(INSTALLDIR) | |
make -C deps/libevent-2.0.1-alpha all install | |
touch token-levent | |
token-ldns: | |
@echo "Installing ldns with prefix $(INSTALLDIR)" | |
cd deps ; tar -zxvf ldns-1.6.5.tar.gz | |
cd deps/ldns-1.6.5 ; ./configure --prefix=$(INSTALLDIR) | |
make -C deps/ldns-1.6.5 all install | |
touch token-ldns | |
install: all | |
cp $(BIN)/* /usr/local/bin/ | |
cp $(LIB)/* /usr/local/lib/ | |
uninstall: all | |
rm $(BIN)/phreebird $(BIN)/phreeload $(BIN)/ldns_chase $(BIN)/unbound_trace | |
rm $(LIB)/phreeload.so | |
clean: | |
rm -f phreebird ldns_chase unbound_trace phreeload.so | |
rm -f $(BIN)/phreebird $(BIN)/phreeload $(BIN)/ldns_chase $(BIN)/unbound_trace $(LIB)/phreeload.so | |
distclean: clean | |
rm -rf $(INSTALLDIR) | |
rm -rf token-ldns token-levent token-lghthash token-lunbound | |
rm -rf deps/ldns-1.6.5 deps/libevent-2.0.1-alpha deps/libghthash-0.6.2 deps/unbound-1.4.3_lite | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment