summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan T. DeKok <aland@freeradius.org>2015-07-13 09:25:16 -0400
committerAlan T. DeKok <aland@freeradius.org>2015-07-13 09:25:16 -0400
commit606e4559c1b2a00390eacc8a1a623660539f36a3 (patch)
treeb49961c1019868afa14bea88a31f14e5319aa2d8
parent86bb0ee4f938c85d74e64b01559a433554ad1ad6 (diff)
downloadlibpam-radius-auth-606e4559c1b2a00390eacc8a1a623660539f36a3.tar.gz
libpam-radius-auth-606e4559c1b2a00390eacc8a1a623660539f36a3.zip
Build objects in src directory
Which is a bit better practice
-rw-r--r--Makefile13
-rw-r--r--src/Makefile7
2 files changed, 14 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index e5b840e..f16c4bd 100644
--- a/Makefile
+++ b/Makefile
@@ -35,11 +35,12 @@ all: pam_radius_auth.so
#
# Build the object file from the C source.
#
-pam_radius_auth.o: src/pam_radius_auth.c src/pam_radius_auth.h
- $(CC) $(CFLAGS) -c $< -o $@
+src/pam_radius_auth.o: src/pam_radius_auth.c src/pam_radius_auth.h
+ @$(MAKE) -C src $(notdir $@)
+
+src/md5.o: src/md5.c src/md5.h
+ @$(MAKE) -C src $(notdir $@)
-md5.o: src/md5.c src/md5.h
- $(CC) $(CFLAGS) -c $< -o $@
#
# This is what should work on Irix:
#pam_radius_auth.so: pam_radius_auth.o md5.o
@@ -58,8 +59,8 @@ md5.o: src/md5.c src/md5.h
#
# gcc -shared pam_radius_auth.o md5.o -lpam -lc -o pam_radius_auth.so
#
-pam_radius_auth.so: pam_radius_auth.o md5.o
- $(CC) $(LDFLAGS) pam_radius_auth.o md5.o -lpam -o pam_radius_auth.so
+pam_radius_auth.so: src/pam_radius_auth.o src/md5.o
+ $(CC) $(LDFLAGS) $^ -lpam -o pam_radius_auth.so
######################################################################
#
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..94b9d76
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,7 @@
+all: pam_radius_auth.o md5.o
+
+pam_radius_auth.o: pam_radius_auth.c pam_radius_auth.h
+ $(CC) $(CFLAGS) -c $< -o $@
+
+md5.o: md5.c md5.h
+ $(CC) $(CFLAGS) -c $< -o $@