| 1 |
# Copyright (C) 2008, Bertrand Mesot <http://www.objectif-securite.ch> |
| 2 |
# 2008, Cedric Tissieres <http://www.objectif-securite.ch> |
| 3 |
# |
| 4 |
# This program is free software; you can redistribute it and/or modify |
| 5 |
# it under the terms of the GNU General Public License as published by |
| 6 |
# the Free Software Foundation; either version 2 of the License, or |
| 7 |
# or (at your option) any later version. |
| 8 |
# |
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
# GNU General Public License for more details. |
| 13 |
# |
| 14 |
# You should have received a copy of the GNU General Public License |
| 15 |
# along with this program; if not, write to the Free Software |
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-13, USA |
| 17 |
|
| 18 |
# General variables |
| 19 |
SHELL = /bin/sh |
| 20 |
|
| 21 |
CC = @CC@ |
| 22 |
|
| 23 |
CPPFLAGS = @CPPFLAGS@ |
| 24 |
CFLAGS = @CFLAGS@ -Icore -Intproba |
| 25 |
LDFLAGS = @LDFLAGS@ @LIBS@ |
| 26 |
|
| 27 |
SUBDIRS = core ntproba samdump2 test |
| 28 |
@HAVE_GUI_TRUE@SUBDIRS += gui |
| 29 |
|
| 30 |
CLEAN_SUBDIRS=$(addprefix clean_,$(SUBDIRS)) |
| 31 |
DISTCLEAN_SUBDIRS=$(addprefix distclean_,$(SUBDIRS)) |
| 32 |
|
| 33 |
.PHONY: all $(SUBDIRS) clean $(CLEAN_SUBDIRS) distclean $(DISTCLEAN_SUBDIRS) |
| 34 |
|
| 35 |
TARGETS = $(SUBDIRS) |
| 36 |
@HAVE_GUI_FALSE@TARGETS += ophcrack |
| 37 |
|
| 38 |
ARCHIVES = \ |
| 39 |
core/libophcrack.a \ |
| 40 |
samdump2/libsamdump2.a \ |
| 41 |
ntproba/libntproba.a |
| 42 |
|
| 43 |
all: $(TARGETS) |
| 44 |
|
| 45 |
$(SUBDIRS): |
| 46 |
$(MAKE) -C $@ |
| 47 |
|
| 48 |
ophcrack: gui/main.cpp core ntproba samdump2 |
| 49 |
cp $< main.c |
| 50 |
$(CC) $(CPPFLAGS) $(CFLAGS) -c main.c -o main.o |
| 51 |
$(CC) main.o $(ARCHIVES) -o $@ $(LDFLAGS) |
| 52 |
rm main.c main.o |
| 53 |
|
| 54 |
gui: core ntproba samdump2 |
| 55 |
test: core ntproba samdump2 |
| 56 |
|
| 57 |
clean: $(CLEAN_SUBDIRS) |
| 58 |
|
| 59 |
$(CLEAN_SUBDIRS): |
| 60 |
$(MAKE) -C $(patsubst clean_%,%,$@) clean |
| 61 |
|
| 62 |
distclean: $(CLEAN_SUBDIRS) $(DISTCLEAN_SUBDIRS) |
| 63 |
rm -f common.mk |
| 64 |
rm -f Makefile |
| 65 |
rm -f ophcrack |
| 66 |
rm -f ophcrack.exe |
| 67 |
|
| 68 |
$(DISTCLEAN_SUBDIRS): |
| 69 |
$(MAKE) -C $(patsubst distclean_%,%,$@) distclean |