summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 $@