summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2013-10-13 03:10:08 +0800
committerLAN-TW <lantw44@gmail.com>2013-10-13 03:10:08 +0800
commita7977c287bac2d19db212158df05bc47c96110ad (patch)
tree78923ac835f7b387857c1ffd46c8ce32184c798a
parent6db932a78e96443950061c96c3f59181f0e0acc0 (diff)
downloadsp2013-a7977c287bac2d19db212158df05bc47c96110ad.tar
sp2013-a7977c287bac2d19db212158df05bc47c96110ad.tar.gz
sp2013-a7977c287bac2d19db212158df05bc47c96110ad.tar.bz2
sp2013-a7977c287bac2d19db212158df05bc47c96110ad.tar.lz
sp2013-a7977c287bac2d19db212158df05bc47c96110ad.tar.xz
sp2013-a7977c287bac2d19db212158df05bc47c96110ad.tar.zst
sp2013-a7977c287bac2d19db212158df05bc47c96110ad.zip
HW1: 加入 autotools build system
-rw-r--r--.gitignore28
-rw-r--r--hw1/Makefile.am21
-rw-r--r--hw1/configure.ac26
3 files changed, 75 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 896b6eb..b5d8517 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,35 @@
+aclocal.m4
+autom4te.cache
+autoscan.log
+compile
config.cache
+config.guess
+config.h
+config.h.in
+config.log
config.status
config.sub
+configure
+configure.scan
+depcomp
+gtk-doc.make
+install-sh
+libtool
+ltmain.sh
+missing
+Makefile
+Makefile.in
+stamp-h1
+
core
core.*
+.deps
+.libs
+*~
*.o
+*.a
+*.lo
+*.la
*.core
*.log
*.aux
@@ -15,3 +41,5 @@ core.*
*.tar.*
hw1/read_server
hw1/write_server
+hw1/sp2013_hw1_slide.pdf
+hw1/sp2013_hw1_spec.pdf
diff --git a/hw1/Makefile.am b/hw1/Makefile.am
new file mode 100644
index 0000000..1d27163
--- /dev/null
+++ b/hw1/Makefile.am
@@ -0,0 +1,21 @@
+EXTRA_DIST = Makefile.simple
+bin_PROGRAMS = read_server write_server
+lib_LIBRARIES = libsphw1.a
+libsphw1_a_SOURCES = common.c common.h server.c server.h main.c
+read_server_SOURCES = proc_r.c proc.h
+read_server_LDADD = $(top_builddir)/libsphw1.a
+write_server_SOURCES = proc_w.c proc.h
+write_server_LDADD = $(top_builddir)/libsphw1.a
+
+dist-hook:
+ cp -a $(distdir)/Makefile.simple $(distdir)/Makefile
+
+submit_tarball_name=SPHW1_b01902062.tar.gz
+submit_dir_name=b01902062
+
+submit: $(submit_tarball_name)
+$(submit_tarball_name): $(PACKAGE)-$(VERSION).tar.gz
+ tar -zxf $(PACKAGE)-$(VERSION).tar.gz
+ mv $(PACKAGE)-$(VERSION) $(submit_dir_name)
+ tar -zcf $(submit_tarball_name) $(submit_dir_name)
+ rm -rf $(submit_dir_name)
diff --git a/hw1/configure.ac b/hw1/configure.ac
new file mode 100644
index 0000000..b4cf785
--- /dev/null
+++ b/hw1/configure.ac
@@ -0,0 +1,26 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_INIT([sphw-b01902062], [1])
+AC_CONFIG_SRCDIR([main.c])
+AC_CONFIG_HEADERS([config.h])
+
+AM_INIT_AUTOMAKE([foreign])
+AM_SILENT_RULES([yes])
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_CC_STDC
+AC_PROG_RANLIB
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_CHECK_HEADER_STDBOOL
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_CHECK_FUNCS([getdtablesize])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT