home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / crypl200.zip / SMAKEFIL.E < prev    next >
Text File  |  1995-08-18  |  4KB  |  116 lines

  1. #****************************************************************************
  2. #*                                                                            *
  3. #*                        Makefile for the encryption library                    *
  4. #*                                                                            *
  5. #****************************************************************************
  6.  
  7. CC        = sc
  8.  
  9. PROJ    = crypt
  10. LIBNAME    = $(PROJ).lib
  11.  
  12. OUTPATH    = SObjs/            # Where object files go (/tmp is a good place)
  13. OBJ        = .o                # Extension for object files
  14.  
  15. LD        = $(CC) link        # Linker (just use the C compiler)
  16. ECHO    = echo                # Echo to screen command
  17. MAKE    = smake                # The make command
  18.  
  19. # The object files which make up the library
  20.  
  21. OBJS    = $(OUTPATH)crypt$(OBJ) $(OUTPATH)lib_3des$(OBJ) $(OUTPATH)lib_des$(OBJ) $(OUTPATH)lib_idea$(OBJ) $(OUTPATH)lib_mdc$(OBJ) $(OUTPATH)lib_null$(OBJ) $(OUTPATH)lib_rc4$(OBJ) $(OUTPATH)idea$(OBJ) $(OUTPATH)3ecb_enc$(OBJ) $(OUTPATH)ecb_enc$(OBJ) $(OUTPATH)pcbc_enc$(OBJ) $(OUTPATH)set_key$(OBJ) $(OUTPATH)rc4$(OBJ) $(OUTPATH)shs$(OBJ)
  22.  
  23. #****************************************************************************
  24. #*                                                                            *
  25. #*            If no args are given, print a usage message and exit            *
  26. #*                                                                            *
  27. #****************************************************************************
  28.  
  29. default:    $(LIBNAME)
  30.  
  31. love:
  32.         @$(ECHO) "Nicht wahr?"
  33.         @$(ECHO)
  34.  
  35. #****************************************************************************
  36. #*                                                                            *
  37. #*                    Rules to build the encryption library                    *
  38. #*                                                                            *
  39. #****************************************************************************
  40.  
  41. # Main directory
  42.  
  43. $(OUTPATH)crypt$(OBJ):        crypt.h crypt.c
  44.                             $(CC) objname $@ crypt.c
  45.  
  46. $(OUTPATH)lib_3des$(OBJ):    crypt.h libdes/des.h lib_3des.c
  47.                             $(CC) objname $@ lib_3des.c
  48.  
  49. $(OUTPATH)lib_des$(OBJ):    crypt.h testdes.h libdes/des.h lib_des.c
  50.                             $(CC) objname $@ lib_des.c
  51.  
  52. $(OUTPATH)lib_idea$(OBJ):    crypt.h idea/idea.h testidea.h lib_idea.c
  53.                             $(CC) objname $@ lib_idea.c
  54.  
  55. $(OUTPATH)lib_mdc$(OBJ):    crypt.h mdc/shs.h lib_mdc.c
  56.                             $(CC) objname $@ lib_mdc.c
  57.  
  58. $(OUTPATH)lib_null$(OBJ):    crypt.h lib_null.c
  59.                             $(CC) objname $@ lib_null.c
  60.  
  61. $(OUTPATH)lib_rc4$(OBJ):    crypt.h testrc4.h rc4/rc4.h lib_rc4.c
  62.                             $(CC) objname $@ lib_rc4.c
  63.  
  64. $(OUTPATH)test$(OBJ):        crypt.h test.c
  65.                             $(CC) objname $@ test.c
  66.  
  67. # idea subdirectory
  68.  
  69. $(OUTPATH)idea$(OBJ):        idea/idea.h idea/idea.c
  70.                             $(CC) objname $@ idea/idea.c
  71.  
  72. # libdes subdirectory
  73.  
  74. $(OUTPATH)3ecb_enc$(OBJ):    libdes/des.h libdes/des_locl.h libdes/3ecb_enc.c
  75.                             $(CC) objname $@ libdes/3ecb_enc.c
  76.  
  77. $(OUTPATH)ecb_enc$(OBJ):    libdes/des.h libdes/des_locl.h libdes/spr.h libdes/version.h libdes/ecb_enc.c
  78.                             $(CC) objname $@ libdes/ecb_enc.c
  79.  
  80. $(OUTPATH)pcbc_enc$(OBJ):    libdes/des.h libdes/des_locl.h libdes/pcbc_enc.c
  81.                             $(CC) objname $@ libdes/pcbc_enc.c
  82.  
  83. $(OUTPATH)set_key$(OBJ):    libdes/des.h libdes/des_locl.h libdes/podd.h libdes/sk.h libdes/set_key.c
  84.                             $(CC) objname $@ libdes/set_key.c
  85.  
  86. # rc4 subdirectory
  87.  
  88. $(OUTPATH)rc4$(OBJ):        rc4/rc4.h rc4/rc4.c
  89.                             $(CC) objname $@ rc4/rc4.c
  90.  
  91. # mdc subdirectory
  92.  
  93. $(OUTPATH)shs$(OBJ):        mdc/shs.h mdc/shs.c
  94.                             $(CC) objname $@ mdc/shs.c
  95.  
  96. # Create the library.  The test program is also listed as a dependancy
  97. # since we need to use OS-specific compiler options for it which a
  98. # simple 'make test' won't give us (yuck).
  99.  
  100. $(LIBNAME):                    $(OBJS) $(OUTPATH)test$(OBJ)
  101.                             oml -n -b $(LIBNAME) r $(OBJS)
  102.  
  103. # Link everything into a test program
  104.  
  105. test:    $(LIBNAME) $(OUTPATH)test$(OBJ)
  106.         @$(LD) pname testcrypt $(OUTPATH)test$(OBJ) lib $(LIBNAME)
  107.  
  108. #****************************************************************************
  109. #*                                                                            *
  110. #*                        Cleanup after make has finished                        *
  111. #*                                                                            *
  112. #****************************************************************************
  113.  
  114. clean:
  115.         delete force \#?.o testcrypt $(LIBNAME)
  116.