aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacob janzen <53062115+JacobJanzen@users.noreply.github.com>2024-02-14 15:52:57 -0600
committerGitHub <noreply@github.com>2024-02-14 21:52:57 +0000
commitb57c21da92563eed58867a9a6b02c201006cbc57 (patch)
treeb42a7654223d228c140870ef711b6f8e499de118
parent7e249ef2644071ca56bdbf7820ca9a66fef23d3c (diff)
Automake (#2)
* gnu autotools build * ignore dist
-rw-r--r--.gitignore17
-rw-r--r--Makefile27
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac15
-rw-r--r--src/Makefile.am13
-rw-r--r--src/cavegen.h (renamed from include/cavegen.h)0
-rw-r--r--src/common.h (renamed from include/common.h)0
-rw-r--r--src/display.h (renamed from include/display.h)0
-rw-r--r--src/entity.h (renamed from include/entity.h)0
-rw-r--r--src/ht.h (renamed from include/ht.h)0
-rw-r--r--src/main.c (renamed from main.c)0
11 files changed, 43 insertions, 30 deletions
diff --git a/.gitignore b/.gitignore
index b9dbfd3..0294c6d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,20 @@
.DS_Store
.idea
*.log
+*~
tmp/
+/.ccls-cache/
+*.in
+*.m4
+/autom4te.cache/
+/build-aux/
+/config.h
+*.status
+/configure
+.deps/
+Makefile
*.o
-build/
-.ccls-cache
-.cache
+/src/main
+/stamp-h1
+/*.gz
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 61be5b0..0000000
--- a/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-CC=clang
-SRCDIR=src
-BUILDDIR=build
-TARGET=$(BUILDDIR)/main
-
-INCLUDE_PATHS=-Iinclude
-LDFLAGS=-lcurses
-
-SRCS=$(wildcard $(SRCDIR)/*.c)
-OBJS=$(patsubst $(SRCDIR)/%.c,$(BUILDDIR)/%.o,$(SRCS))
-
-all: $(TARGET)
-
-$(BUILDDIR)/%.o: $(SRCDIR)/%.c
- mkdir -p $(BUILDDIR)
- $(CC) -c $(CFLAGS) $(INCLUDE_PATHS) $^ -o $@
-
-$(BUILDDIR)/main.o: main.c
- mkdir -p $(BUILDDIR)
- $(CC) -c $(CFLAGS) $(INCLUDE_PATHS) $^ -o $@
-
-$(TARGET): $(OBJS) $(BUILDDIR)/main.o
- mkdir -p $(BUILDDIR)
- $(CC) -o $@ $(LDFLAGS) $^
-
-clean:
- rm -rf $(BUILDDIR)
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..af437a6
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..8e6420e
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,15 @@
+AC_PREREQ([2.65])
+AC_INIT([roguelike], [0.1], [jacob.a.s.janzen@gmail.com])
+AC_CONFIG_SRCDIR([src/main.c])
+AC_CONFIG_AUX_DIR([build-aux])
+
+AC_PROG_CC
+AC_CHECK_LIB([curses], [initscr])
+AC_CHECK_HEADERS([curses.h])
+
+AM_INIT_AUTOMAKE([foreign -Wall -Werror])
+
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([Makefile src/Makefile])
+
+AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..b6114f2
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,13 @@
+bin_PROGRAMS = main
+
+main_SOURCES = \
+ cavegen.c \
+ cavegen.h \
+ display.c \
+ display.h \
+ ht.c \
+ ht.h \
+ common.h \
+ entity.h \
+ main.c
+
diff --git a/include/cavegen.h b/src/cavegen.h
index b6ed1e4..b6ed1e4 100644
--- a/include/cavegen.h
+++ b/src/cavegen.h
diff --git a/include/common.h b/src/common.h
index 11b11d4..11b11d4 100644
--- a/include/common.h
+++ b/src/common.h
diff --git a/include/display.h b/src/display.h
index d9c66bb..d9c66bb 100644
--- a/include/display.h
+++ b/src/display.h
diff --git a/include/entity.h b/src/entity.h
index b003efe..b003efe 100644
--- a/include/entity.h
+++ b/src/entity.h
diff --git a/include/ht.h b/src/ht.h
index ef15540..ef15540 100644
--- a/include/ht.h
+++ b/src/ht.h
diff --git a/main.c b/src/main.c
index 086a093..086a093 100644
--- a/main.c
+++ b/src/main.c