diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c28580 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +chargen +*.o diff --git a/Makefile b/Makefile index c2a8881..c1085e5 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ -CC=cc LIBS=-lm -server: - ${CC} -o chargen ${LIBS} chargen.c +all: -all: server generator +chargen: chargen.o character.o + ${CC} -o chargen ${LIBS} $^ $> + +all: chargen .PHONY: all diff --git a/character.c b/character.c index 6eb1525..b0f226a 100644 --- a/character.c +++ b/character.c @@ -2,6 +2,8 @@ #include #include #include + +#include "chargen.h" #include "character.h" int dieroll(int num,int sides){ diff --git a/character.h b/character.h index f255fd1..c8bee84 100644 --- a/character.h +++ b/character.h @@ -93,5 +93,3 @@ char* backgrounds[] = { "Acolyte", "Charlatan", "Criminal", "Entertainer", "Folk int stats[6]; int mods[6]; int hp; - -char* genChar(); diff --git a/chargen.c b/chargen.c index 3182bd9..37b2a03 100644 --- a/chargen.c +++ b/chargen.c @@ -11,7 +11,7 @@ #include #include -#include "character.c" +#include "chargen.h" void usage_and_die(const char *myname, const char *fmt, ...) { @@ -148,9 +148,6 @@ int main(int argc, char **argv) if (num_packet + num_listen == 0) errx(EXIT_FAILURE, "No listeners to run on!\n"); - if (pledge("stdio inet error", NULL) == -1) - warn("pledge"); - while(1) { fd_set r, w; diff --git a/chargen.h b/chargen.h new file mode 100644 index 0000000..334994a --- /dev/null +++ b/chargen.h @@ -0,0 +1,6 @@ +#ifndef H_CHARGEN +#define H_CHARGEN + +char* genChar(); + +#endif