| 1 |
# Makefile.am adapted from Cygwin ioperm |
| 2 |
# http://openwince.sourceforge.net/ioperm/ |
| 3 |
# |
| 4 |
# Copyright (C) 2003 ETC s.r.o. |
| 5 |
# Copyright (C) 2007 Kevin Kofler |
| 6 |
# |
| 7 |
# This program is free software; you can redistribute it and/or |
| 8 |
# modify it under the terms of the GNU General Public License |
| 9 |
# as published by the Free Software Foundation; either version 2 |
| 10 |
# of the License, or (at your option) any later version. |
| 11 |
# |
| 12 |
# This program is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with this program; if not, write to the Free Software Foundation, |
| 19 |
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 |
# 02111-1307, USA. |
| 21 |
# |
| 22 |
# Written by Marcel Telka <[email protected]>, 2003. |
| 23 |
# |
| 24 |
|
| 25 |
EXTRA_DIST = dhahelper.c dhahelper.rc common.ver ntverp.h ReadMe.txt dhahelper.bat dhasetup.bat dhasetup.dsp dhasetup.dsw SOURCES NMAKEFILE |
| 26 |
|
| 27 |
if OS_WIN32 |
| 28 |
bin_PROGRAMS = dhasetup |
| 29 |
dhasetup_SOURCES = dhasetup.c dhahelper.h |
| 30 |
bin_SCRIPTS = dhahelper.sys |
| 31 |
else |
| 32 |
EXTRA_DIST += dhasetup.c dhahelper.h |
| 33 |
endif |
| 34 |
|
| 35 |
RC ?= windres |
| 36 |
|
| 37 |
dhahelper.$(OBJEXT): $(srcdir)/dhahelper.c $(srcdir)/dhahelper.h |
| 38 |
$(CC) $(CPPFLAGS) -Wall -Os -c $(srcdir)/dhahelper.c -o dhahelper.$(OBJEXT) |
| 39 |
|
| 40 |
dhahelper-rc.$(OBJEXT): $(srcdir)/dhahelper.rc $(srcdir)/common.ver $(srcdir)/ntverp.h |
| 41 |
$(RC) -I. dhahelper.rc $@ |
| 42 |
|
| 43 |
base.tmp: dhahelper.$(OBJEXT) dhahelper-rc.$(OBJEXT) |
| 44 |
$(CC) $(CPPFLAGS) -Wl,--base-file,base.tmp \ |
| 45 |
-Wl,--entry,_DriverEntry@8 \ |
| 46 |
-nostartfiles -nostdlib \ |
| 47 |
-o junk.tmp \ |
| 48 |
dhahelper.$(OBJEXT) dhahelper-rc.$(OBJEXT) \ |
| 49 |
-lntoskrnl |
| 50 |
-rm -f junk.tmp |
| 51 |
|
| 52 |
temp.exp: base.tmp |
| 53 |
$(DLLTOOL) --dllname dhahelper.sys --base-file base.tmp --output-exp temp.exp |
| 54 |
|
| 55 |
dhahelper.sys: dhahelper.$(OBJEXT) dhahelper-rc.$(OBJEXT) temp.exp |
| 56 |
$(CC) $(CPPFLAGS) -Wl,--subsystem,native \ |
| 57 |
-Wl,--image-base,0x10000 \ |
| 58 |
-Wl,--file-alignment,0x1000 \ |
| 59 |
-Wl,--section-alignment,0x1000 \ |
| 60 |
-Wl,--entry,_DriverEntry@8 \ |
| 61 |
-Wl,temp.exp \ |
| 62 |
-mdll -nostartfiles -nostdlib \ |
| 63 |
-o dhahelper.sys \ |
| 64 |
dhahelper.$(OBJEXT) dhahelper-rc.$(OBJEXT) \ |
| 65 |
-lntoskrnl |
| 66 |
$(STRIP) dhahelper.sys |
| 67 |
|
| 68 |
CLEANFILES = dhahelper.sys dhahelper.$(OBJEXT) dhahelper-rc.$(OBJEXT) base.tmp temp.exp |